- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I'm new in the Visual Fortran world and need your help. So here's the point :
I have to upgrade an old Vs6/Fortran PowerStation code base to vs2017/Visual Fortran.
I've already setup vs2017, Intel Parallel Studio 2018, recompile the sources etc ...
My Project is basically a win MFC app which link with a huge Visual Fortran static lib (.vfproj)
All runtime are properly set :
RELEASE config : c/c++ runtime = Multithread /MT - Fortran runtime : MultiThreaded
DEBUG config : c/c++ runtime = Debug Multithread /MTd - Fortran runtime : Debug Multithreaded
In the final linking step, i encounter several error link LNK2005 xxxxx already defined in libmmt.lib
In RELEASE configuration, to fix the Linking error (cos, sin, pow already defined) i used the solution provided by Steve Lionel (last answer)
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/276325
So i put libmmt.lib first in my additionals dependencies and everything goes fine.
In DEBUG configuration this solution is no longer working i get the following errors :
1>libucrtd.lib(acos.obj) : error LNK2005: _acos déjà défini(e) dans libmmt.lib(acos_iface_c99.obj) 1>libucrtd.lib(acos.obj) : error LNK2005: __CIacos déjà défini(e) dans libmmt.lib(acos_iface_c99.obj) 1>libucrtd.lib(cos.obj) : error LNK2005: _cos déjà défini(e) dans libmmt.lib(cos_iface_c99.obj) 1>libucrtd.lib(cos.obj) : error LNK2005: __CIcos déjà défini(e) dans libmmt.lib(cos_iface_c99.obj) 1>libucrtd.lib(sin.obj) : error LNK2005: _sin déjà défini(e) dans libmmt.lib(sin_iface_c99.obj) 1>libucrtd.lib(sin.obj) : error LNK2005: __CIsin déjà défini(e) dans libmmt.lib(sin_iface_c99.obj) 1>libucrtd.lib(pow.obj) : error LNK2005: _pow déjà défini(e) dans libmmt.lib(pow_iface_c99.obj) 1>libucrtd.lib(pow.obj) : error LNK2005: __CIpow déjà défini(e) dans libmmt.lib(pow_iface_c99.obj) 1>LINK : warning LNK4098: conflit entre la bibliothèque par défaut 'LIBCMT' et les autres bibliothèques ; utilisez /NODEFAULTLIB:library
How to fix it ?
Best regards
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the Debug configuration, replace libmmt.lib with libmmtd.lib.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve,
VS2017 said : unable to open libmmtd.lib.
I guess something which rely on the debug was not installed at setup time.
Is "Intel Debugger extension" enough to fix it or should i install "Intel C++ compiler" too ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I thought there was a libmmtd but there isn't.
I suggest you try DLL linking instead - change the libraries in both Fortran and C++ to Multithread DLL. (In the Debug configuration, you can use Multithread Debug DLL but it isn't necessary.)
You don't need the "Intel Debugger Extension" - that's used when working with programs that use the Intel Xeon Phi coprocessors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Doctor Fortran !
Debugging is now working !
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page