473,385 Members | 1,465 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,385 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 3678
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.