By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,786 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,786 IT Pros & Developers. It's quick & easy.

Can anybody help me linking Fortran into C++

P: n/a
I use gcc compiler (version 2.8.1). During linking I get the following
error message:

Undefined first referenced
symbol in file
log10l /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(write.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(error.o)
ld: fatal: Symbol referencing errors. No output written to symsimp
collect2: ld returned 1 exit status
gmake: *** [symsimp] Error 1

Does anybody know where I can find libraries with those functions?

Jul 24 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
a-***@o2.pl a écrit :
I use gcc compiler (version 2.8.1).
2.8.1 ? It is 9 year old.
During linking I get the following
error message:

Undefined first referenced
symbol in file
log10l /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(write.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(error.o)
ld: fatal: Symbol referencing errors. No output written to symsimp
collect2: ld returned 1 exit status
gmake: *** [symsimp] Error 1

Does anybody know where I can find libraries with those functions?
Your compiler looks into /opt/gcc_4.1.2/solaris10/ for gcc v4.1.2.

I think you have a path issue in your toolchain.

Michael
Jul 24 '07 #2

P: n/a
>
Your compiler looks into /opt/gcc_4.1.2/solaris10/ for gcc v4.1.2.

I think you have a path issue in your toolchain.

Michael

Thank you for your reply.
The problem is bit coplicated...

1. The reason I'm using 2.8.1 is that the ARPACK++ library I'm going
to use (some numerical linear algebra library interface) compiles only
in 2.8.1 (don't ask me why :P but it is not my task to change the
library code)

2. The fortran compiler I used is distributed with 4.1.2 version of
gcc compiler, that's why you see references to the file /opt/gcc_4.1.2/
solaris10/lib/libgfortran.a

3. Unfortunatelly the older versions of fortran copilers doesn't have
the library libgfortran.a (probably it was not installed by system
administrator :/). That's why I must use library from new gcc.

Or maybe you have some more ideas?

Janusz

Jul 24 '07 #3

P: n/a
On 24 Lip, 13:55, Michael DOUBEZ <michael.dou...@free.frwrote:
a-...@o2.pl a écrit :
I use gcc compiler (version 2.8.1).

2.8.1 ? It is 9 year old.
During linking I get the following
error message:
Undefined first referenced
symbol in file
log10l /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(write.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(error.o)
ld: fatal: Symbol referencing errors. No output written to symsimp
collect2: ld returned 1 exit status
gmake: *** [symsimp] Error 1
Does anybody know where I can find libraries with those functions?

Your compiler looks into /opt/gcc_4.1.2/solaris10/ for gcc v4.1.2.

I think you have a path issue in your toolchain.

Michael

Thank you for your reply.
The problem is bit coplicated...

1. The reason I'm using 2.8.1 is that the ARPACK++ library I'm going
to use (some numerical linear algebra library interface) compiles only
in 2.8.1 (don't ask me why :P but it is not my task to change the
library code)

2. The fortran compiler I used is distributed with 4.1.2 version of
gcc compiler, that's why you see references to the file /opt/gcc_4.1.2/
solaris10/lib/libgfortran.a

3. Unfortunatelly the older versions of fortran copilers doesn't have
the library libgfortran.a (probably it was not installed by system
administrator :/). That's why I must use library from new gcc.

Or maybe you have some more ideas?

Janusz

Jul 24 '07 #4

P: n/a
a-***@o2.pl a écrit :
On 24 Lip, 13:55, Michael DOUBEZ <michael.dou...@free.frwrote:
>a-...@o2.pl a écrit :
>>I use gcc compiler (version 2.8.1).
2.8.1 ? It is 9 year old.
>>During linking I get the following
error message:
Undefined first referenced
symbol in file
log10l /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(write.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(error.o)
ld: fatal: Symbol referencing errors. No output written to symsimp
collect2: ld returned 1 exit status
gmake: *** [symsimp] Error 1
Does anybody know where I can find libraries with those functions?
Your compiler looks into /opt/gcc_4.1.2/solaris10/ for gcc v4.1.2.

I think you have a path issue in your toolchain.

Thank you for your reply.
The problem is bit coplicated...

1. The reason I'm using 2.8.1 is that the ARPACK++ library I'm going
to use (some numerical linear algebra library interface) compiles only
in 2.8.1 (don't ask me why :P but it is not my task to change the
library code)

2. The fortran compiler I used is distributed with 4.1.2 version of
gcc compiler, that's why you see references to the file /opt/gcc_4.1.2/
solaris10/lib/libgfortran.a

3. Unfortunatelly the older versions of fortran copilers doesn't have
the library libgfortran.a (probably it was not installed by system
administrator :/). That's why I must use library from new gcc.

Or maybe you have some more ideas?
A hint perhaps: the functions it doesn't find are likely to be C99
function (ANSI C has only strtod not strtold, _assert_c99 ...).

You will have to perform the final link with gcc 4.1.2 or recompile
libgfortran.a in ansi C. man gcc is your friend here.

Michael
Jul 24 '07 #5

P: n/a
a-***@o2.pl wrote:
On 24 Lip, 13:55, Michael DOUBEZ <michael.dou...@free.frwrote:
>a-...@o2.pl a écrit :
I use gcc compiler (version 2.8.1).

2.8.1 ? It is 9 year old.
During linking I get the following
error message:
Undefined first referenced
symbol in file
log10l /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(write.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(read.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(error.o)
ld: fatal: Symbol referencing errors. No output written to symsimp
collect2: ld returned 1 exit status
gmake: *** [symsimp] Error 1
Does anybody know where I can find libraries with those functions?

Your compiler looks into /opt/gcc_4.1.2/solaris10/ for gcc v4.1.2.

I think you have a path issue in your toolchain.

Michael


Thank you for your reply.
The problem is bit coplicated...

1. The reason I'm using 2.8.1 is that the ARPACK++ library I'm going
to use (some numerical linear algebra library interface) compiles only
in 2.8.1 (don't ask me why :P but it is not my task to change the
library code)
A lot has changed since then. C++ was standardised, for instance. If you
need features of the 2.8.1 GCC, you are probably best off sticking to this
release, however. Changing the library code may be the worst thing to do.
2. The fortran compiler I used is distributed with 4.1.2 version of
gcc compiler, that's why you see references to the file /opt/gcc_4.1.2/
solaris10/lib/libgfortran.a
The gfortran compiler is relatively new. Earlier versions of GCC shipped
only a Fortran 77 compiler, called with g77.
3. Unfortunatelly the older versions of fortran copilers doesn't have
the library libgfortran.a (probably it was not installed by system
administrator :/). That's why I must use library from new gcc.
I believe libgfortran is new with the gfortran compiler.
Or maybe you have some more ideas?
Standard C++, the topic of this newsgroup, has no means of communicating
with fortran. Since you are using both the GNU C++ and the GNU fortran
compilers (?), I suggest you ask in a GNU forum.

--
rbh
Jul 24 '07 #6

P: n/a
a-***@o2.pl a écrit :
[snip]
3. Unfortunatelly the older versions of fortran copilers doesn't have
the library libgfortran.a (probably it was not installed by system
administrator :/). That's why I must use library from new gcc.
I don't know the content of your server but f77 (or f95) may be more
useful than using gcc for compiling fortran.

Michael
Jul 24 '07 #7

P: n/a
On 24 Lip, 15:23, Michael DOUBEZ <michael.dou...@free.frwrote:
a-...@o2.pl a écrit :
[snip]
3. Unfortunatelly the older versions of fortran copilers doesn't have
the library libgfortran.a (probably it was not installed by system
administrator :/). That's why I must use library from new gcc.

I don't know the content of your server but f77 (or f95) may be more
useful than using gcc for compiling fortran.
We have f77, but it has some 'licence problems'. Probably I should
talk with system administrator about it but it is not so easy to get
in touch with him.

Jul 24 '07 #8

P: n/a
The gfortran compiler is relatively new. Earlier versions of GCC shipped
only a Fortran 77 compiler, called with g77.
Thanks for the tip. I already discovered that we have version 2.95.1
of gcc with g77. The previous problems vanished, however the new
problems occured. Do you have any ideas about this:

symbol in file
s_cmp /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dsaupd.o)
do_fio /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dsaupd.o)
e_wsfe /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dsaupd.o)
pow_dd /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dseupd.o)
s_copy /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dseupd.o)
s_stop /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(xerbla.o)
s_wsfe /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dsaupd.o)
G77_second_0 /home/werkstud/janusz/
linear_algebra/ARPACK/libarpack_SUN4.a(dsconv.o)
ld: fatal: Symbol referencing errors. No output written to symsimp
collect2: ld returned 1 exit status
gmake: *** [symsimp] Error 1
Standard C++, the topic of this newsgroup, has no means of communicating
with fortran. Since you are using both the GNU C++ and the GNU fortran
compilers (?), I suggest you ask in a GNU forum.
I probably will.

J.

Jul 24 '07 #9

P: n/a
Thank you everybody for help. It appears that I finally solved the
problem...

The solution was:

1. Use g77 instead of gfortran
2. Link the libg2c.a library

I expect other problems (because the rest of the programme is compiled
with newer compiler) but recent problems are solved :D

J.

Jul 24 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.