C++和Fortran混合编程时调用数学函数的问题: error LNK2005: __matherr already defined in LIBCD.lib


编译提示错误: 
Linking... 
dfor.lib(matherr.obj) : error LNK2005: __matherr already defined in LIBCD.lib(matherr.obj) 
LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library 
Debug/StaggeredGrid.exe : fatal error LNK1169: one or more multiply defined symbols found 
Error executing link.exe. 
解决方法: 
在主程序中添加 
#pragma comment (lib, "dfor") 

你可能感兴趣的:(编程,C++,fortran)