473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can anybody help me linking Fortran into C++

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
9 3679
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
>
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Hagelberg | last post by:
I'm trying to create a python module which can be used by a python interpreter embedded inside a fortran program I have. To do this, I first created python wrappers for all the functions in my...
2
by: sunil | last post by:
Hi, We have lot of c and fortran archive libraries that have complex dependencies. We have different server tasks that use some of these libraries. We have developed a tool inhouse that links...
13
by: NM | last post by:
Sometimes ago I was having a problem in linking between C++ and Fortran program. That was solved (using input from this newsgroup) using the Fortran keyword "sequence" with the derived types (to...
4
by: Kevin Wan | last post by:
Hi, I have encountered a linking problem while using g++ to link our product. There are Fortran, C, C++ code in our product. The error listed below: /usr/bin/ld: final link failed: Bad value...
2
by: | last post by:
Help! I'm new to c++, and am breaking my teeth on MS Visual C++ (bundled within Visual Studio .NET 2003). Am trying to link simple c++ code to fortran dlls created in Compaq Visual Fortran (v6.1)....
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
0
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
3
by: grspinto | last post by:
Hi there, I am not very used to programming and I am trying to call a Fortran function/subroutine with a C++ main program, but it haven't worked. Untill now, I've been trying to build the easiest...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.