need help on gfortran and C++
Mojtaba Seifi
mojtaba.seifi@gmail.com
Wed Jan 11 08:40:00 GMT 2012
Dear Sir/Madam,
I'm trying to compile a simple fortran code using gfortran and then
using this library in a C++ code (compiling by g++). The simple codes
for fortran and C++ are attached. I use the following commands in
terminal (ubuntu) for this purpose:
gfortran -c FSub.f90
ar -rcs libFsub.a FSub.o
g++ -c main.cpp
g++ -o main.exe main.o -L/`pwd` -lFsub
But I get the following error:
--------------
main.o: In function `main':
main.cpp:(.text+0x41): undefined reference to `MULTAB_'
collect2: ld returned 1 exit status
--------------
I couldn't find any solution on the Internet for this issue.
Would you please help me on this. I'm new in linux and have no idea how
to fix this.
Thank you.
--
Mojtaba
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FSub.f90
Type: text/x-fortran
Size: 123 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120111/1068bf66/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 541 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120111/1068bf66/attachment-0001.bin>
More information about the Gcc-help
mailing list