- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If a project is compiled in MSVS under the Debug configuration with the setting for runtime library as
(a) Multithreaded
(b) Debug Multithreaded
then the difference in the compile command of (a) vs (b) is
(a) /libs:static /threads
(b) /libs:static /threads /dbglibs
My questions are:
(1) What is the difference between these two options?
(2) Would the fact that they are both under the Debug configuration render them the same?
(3) What is the default option for IVF?
(4) Using a library generated with option (b) that is subsequently linked in another project with the option (a) generates the warning:
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
Is this warning OK to ignore?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(1) /dbglibs causes the debug versions of the Microsoft Visual C++ libraries to be referenced. These have some different behaviors in added correctness checking for allocations and more.
(2) No.
(3) The default is /dbglibs for a Debug configuration, and the non-debug libraries for a Release configuration
(3) No, it is not safe to ignore and can cause difficult-to-diagnose problems. My advice is to change your library project property Fortran > Libraries > Disable default library search rules to Yes. This means that the static library objects themselves will not request any particular run-time libraries, relying on the executable project to do so. If the executable is also Fortran, that's all you need. If the executable is C++, then you'll have to name the necessary Fortran libraries (ifcoremd, etc.) in the C++ project's "Additional dependencies" linker property.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(1) /dbglibs causes the debug versions of the Microsoft Visual C++ libraries to be referenced. These have some different behaviors in added correctness checking for allocations and more.
(2) No.
(3) The default is /dbglibs for a Debug configuration, and the non-debug libraries for a Release configuration
(3) No, it is not safe to ignore and can cause difficult-to-diagnose problems. My advice is to change your library project property Fortran > Libraries > Disable default library search rules to Yes. This means that the static library objects themselves will not request any particular run-time libraries, relying on the executable project to do so. If the executable is also Fortran, that's all you need. If the executable is C++, then you'll have to name the necessary Fortran libraries (ifcoremd, etc.) in the C++ project's "Additional dependencies" linker property.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:(1) /dbglibs causes the debug versions of the Microsoft Visual C++ libraries to be referenced. These have some different behaviors in added correctness checking for allocations and more.
(2) No.
(3) The default is /dbglibs for a Debug configuration, and the non-debug libraries for a Release configuration
(3) No, it is not safe to ignore and can cause difficult-to-diagnose problems. My advice is to change your library project property Fortran > Libraries > Disable default library search rules to Yes. This means that the static library objects themselves will not request any particular run-time libraries, relying on the executable project to do so. If the executable is also Fortran, that's all you need. If the executable is C++, then you'll have to name the necessary Fortran libraries (ifcoremd, etc.) in the C++ project's "Additional dependencies" linker property.
Thanks. This is helpful, especially (2) and (4). So the fact that you chose a Debug configuration does not imply the same properties. Also, finally understood what disable default library search rules means. Will make the appropriate changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I should add that even though Intel Fortran provides "debug" libraries of its own (libifcoremdd, libifcorertd, etc.) these are the same as the "non-debug" versions. The difference is in the MSVC libraries. If you have any C++ code, though, you must be sure to link with the correct set of libraries as the C++ compiler generates different code depending on whether you are using debug libraries or not.
And of course I meant to number the last one (4)...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page