logo       

Re: Problems to link C++ files to a Fortran 77 file: msg#00211

gcc.help

Subject: Re: Problems to link C++ files to a Fortran 77 file

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@xxxxxxxxxxxxxxxxxxxx - 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)




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise