Re: Problem to use NAG libraries in C++
- From: robert.corbett@xxxxxxx
- Date: 30 Jan 2007 00:41:20 -0800
On Jan 29, 6:23 am, "SimonG" <s...@xxxxxxxxxxxxxx> wrote:
There error you're reporting is a linker error not a compiler error.
It is caused by trying to link a program containing C++ and fortran
via the fortran compiler. If your main program is in C++ this is a bad
idea (for reasons I won't go into here) and should be avoided. Insead
link your main program with C++ and pass the nag library to it as well
as the required fortran libraries (I've no idea where they are on the
Sun):
CC -c usingnag.cpp -lnag -l<your fortran library> -lm
Your main program might need to call a fortran library initialization
routine - you'll need to consult Sun's documantation for that).
You're right that the OP should used CC to link. Sun's documentation
states that mixed C and Fortran programs should be linked using the
Fortran driver. A program that uses any C++ should be linked with
the C++ driver. The command line option -xlang eliminates the need
to know which libraries are needed.
Bob Corbett
.
- References:
- Problem to use NAG libraries in C++
- From: Diaboflo
- Re: Problem to use NAG libraries in C++
- From: SimonG
- Problem to use NAG libraries in C++
- Prev by Date: Re: Declaration to get 8-bit (or 16-bit) integer?
- Next by Date: Re: nested loop is not working...im new
- Previous by thread: Re: Problem to use NAG libraries in C++
- Next by thread: What is going on with Lahey?
- Index(es):
Relevant Pages
|