This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]