This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problems to link C++ files to a Fortran 77 file
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Gustavo Bevilacqua Leal <gustavob at cetuc dot puc-rio dot br>
- Cc: gcc-help at gnu dot org
- Date: Sat, 24 May 2003 00:05:57 +0200
- Subject: Re: Problems to link C++ files to a Fortran 77 file
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <5.1.0.14.0.20030522175532.00b26ab8@mamona.cetuc.puc-rio.br>
Gustavo Bevilacqua Leal wrote:
The first problem happened as I tried to include the
file g2c.h. Whenever I included it in a C code, the compiler emits
an error at line 21:
line 21 -> typedef __g77_integer integer;
Fixed in 3.3
The second problem is fatal and happened during linkage.
Following the manual's advice I linked the code with g77,
but g77 couldn't find the C++ intrisics like std::cout.
Then I decided to link all the files with gcc, however in this case
all the fortran intrisics couldn't be found, for example the function
_s_rnge,
used for check array bound, archived in libg2c.a.
Use g++ -o <exe>.exe main.o lib1.a lib2.a -lg2c.a
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)