473,625 Members | 2,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(w rite.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(e rror.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 3689
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(w rite.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(e rror.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(w rite.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(e rror.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_c9 9 /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(w rite.o)
strtof /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
strtold /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(r ead.o)
__assert_c99 /opt/gcc_4.1.2/solaris10/lib/
libgfortran.a(e rror.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
2585
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 fortran program using f2py. I then start an embedded python interpreter in c code which I link against the fortran program. I invoke the fortran program with a filename containing python code. This file is passed to the c code which passes it on...
2
1687
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 server tasks by continuously iterating until it figures out the correct library order. Recently we introduced some C++ legacy libraries. I am completely new to C++ linking. Is there some tutorial that can explain the nuances of C++ linking? We do...
13
2526
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 assume contiguous space). Now I am having problem again. In order to show the problem I have created small program and this time there is no data straucture being passed between C++ and Fortran. Here is how the program looks like
4
3917
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 collect2: ld returned 1 exit status But no any reasons or suggestions are given, I'm so puzzled!
2
7245
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). Posts concerning this topic are common, but none of the posted solutions I've tried work correctly with the above software. The linker can't seem to find the dll (reports 'unresolved external symbol __imp__IMSL_FUN@8'; IMSL_FUN.dll is the f77...
10
2677
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 .NET2003. also, when I do not try to link the fortran library (just to see if that was the cause), it builds the exe without any problems. i don't even know how to begin addressing this problem...any help would be
0
3976
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
2046
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 program possible, such as c++ calling a c = a + b fortran function. I am trying this on a VS 2005 c++ along with an Intel Visual Fortran. I have been looking for some answers on this forum and I've made these routines: c++-------- #include...
0
8253
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.