|
Problems to link C++ files to a Fortran 77 file: msg#00197gcc.help
From Gustavo, At this moment I am writing a simulation program that uses some C++ routines and one Fortran procedure. I've read the manual on all the subsections about interoperability between C and Fortran: http://gcc.gnu.org -> Manual -> GCC 3.2.2 G77 Manual -> Other Languages -> Interoperating with C and C++ Even after following the instructions inside, I couldn't link all the modules together. 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; It happened because nowhere the type __g77_integer is declared. So the first question is: how do I use the include file g2c.h properly? 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. Then I tried to use ld, and in this case the intrisics of both had not been found. All these errors appeared even if I forced the linker to include the adequate libraries; libg2c.a, libstd++.a and so forth. Then I ask how do I link the modules? What is the diference between linking with g77, g++ or ld? If these linkers behaved equally, then they would collect the symbols equally. Thanks for your help, Gustavo. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | header sources not found in gdb: 00197, Dave Lawrence |
|---|---|
| Next by Date: | C Language Help: 00197, John Anthony Kazos Jr. |
| Previous by Thread: | header sources not found in gdbi: 00197, Dave Lawrence |
| Next by Thread: | Re: Problems to link C++ files to a Fortran 77 file: 00197, Toon Moene |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |