Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussões

libifcoremt.lib : error LNK2005 .... already defined

longden_loo
Principiante
2.507 Visualizações
I'm getting alot of "already defined" LNK2005 errors during linking, and both libraries (libifcoremt and libifcore) where the definitions are defined are part of the v9 compiler:
libifcoremt.lib(for_reentrancy.obj) : error LNK2005: _for_set_reentrancy already defined in libifcore.lib(for_reentrancy.obj)
Is there something I need to toggle to avoid getting this error?
0 Kudos
8 Respostas
Steven_L_Intel1
Funcionário
2.507 Visualizações
You're pulling in both the threaded and non-threaded version of the libraries. Make sure that all Fortran sources you link in were compiled with the same setting for "Libraries..Use run-time libraries".
longden_loo
Principiante
2.507 Visualizações
Thanks, I'll make that change.
This was a port from CVF ... was there an equivalent setting there? I don't recall manually specifying the "Runtime Library" type during the port for each of the 23 projects inmy solution.
TimP
Colaborador honorário III
2.507 Visualizações
This usually means that you have both .obj built without a threading option (such as -Qparallel or -Qopenmp) and with such an option, including .obj from Intel Performance Libraries. The preferred solution is to turn on the appropriate option throughout. It may also be possible to suppress the complaint by using e.g.
/link /nodefaultlib:libifcore.lib
to tell Microsoft linker you don't want the non-threaded library.
longden_loo
Principiante
2.507 Visualizações
I don't see those options (-Qparallel or -Qopenmp) in the existing Visual Studio IDE, but setting all the project Runtime Library settings to "Debug Multithreaded" took care of all the LNK2005 complaints. Thanks.
Now down to only 2 link errors for this particular project, which is part of a large Fortran/C/Java application. The link error appears related to JNI (the C/Java interface) so it has nothing to do with Fortran (I think):
common.lib(AppInterface.obj) : error LNK2019: unresolved external symbol __imp__JNI_CreateJavaVM@12 referenced in function _App_createJavaVM
I tried adding the path to the Java jvm.dll to various places in the IDE with no success. Anyone here doing JNI on .NET that can suggest where I need to tweak it for JNI linking?
Steven_L_Intel1
Funcionário
2.507 Visualizações
It's not the DLL you want, but the JNI export library (.lib), if there is one. You would have had to specify this in CVF too.
longden_loo
Principiante
2.507 Visualizações
OK, I've confirmed there's a jvm.lib and the dumpbin command shows the references I'm looking for in there. I tried adding the jvm.lib path and filename to the project (Linker/Advanced/ImportLibrary) but it didn't seem to find it during the link.
Where in the .NET IDE do you specify the export libraries?
Steven_L_Intel1
Funcionário
2.507 Visualizações
Easiest way is to just add the .lib to your project as if it were a source file.
longden_loo
Principiante
2.507 Visualizações
That did it, thanks!
Also tried adding the path/filename to Linker/Input/AdditionalDependencies and that seemed to work too. I had tried this earlier without success, but it may have been due to some other problems.
Responder