Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28469 Discussions

Library Problems with C++ and Fortran Mixed Language Program

rcampbell1979
Beginner
792 Views
I am mixing Visual C++ 6 Visual Fortran 6.5 by calling Fortran subroutines with a C++ main program using both Complex and Double data types. I am getting this math error when using some common math functions, i.e. sqrt. The error is as follows:
dfor.lib(matherr.obj) : error LNK2005: __matherr already defined in LIBCD.lib(matherr.obj)
Debug/ExampC4.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.


I have searched the help pages and have not found any help. The project settings for my project are below.

The Project Settings for Link are:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/ExampC4.pdb" /debug /machine:I386 /out:"Debug/ExampC4.exe" /pdbtype:sept 


The Project Settings for Fortran are:
/compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt /module:"Debug/" /object:"Debug/" /pdbfile:"Debug/DF60.PDB" 


The Project Settings for C++ are:
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/ExampC4.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 


Does anyone know what might be the problem?
0 Kudos
2 Replies
james1
Beginner
792 Views
See here.
0 Kudos
rcampbell1979
Beginner
792 Views
Thanks so much!
0 Kudos
Reply