- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear forum,
I have a solution which contains a DLL, which in turns relies on a static library. When I build this DLL, I get the following warning message:
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
It is just a warning... but what should I do to eliminate it? What are the consequences of ignoring this warning?
Thanks,
Olivier
I have a solution which contains a DLL, which in turns relies on a static library. When I build this DLL, I get the following warning message:
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
It is just a warning... but what should I do to eliminate it? What are the consequences of ignoring this warning?
Thanks,
Olivier
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
World War III could start. Or you could get subtle run-time errors due to having two run-time libraries loaded.
Your static library was built with one choice for run-time libraries (probably multithread debug) and did not have the "OBJCOMMENT directives" for default libraries disabled (/Zl, or in Fortran, /libdir:noauto). Your DLL project specifies, by default, multithread DLL.
The solution is to make sure that all objects and libraries are compiled with the same setting for run-time libraries.
Your static library was built with one choice for run-time libraries (probably multithread debug) and did not have the "OBJCOMMENT directives" for default libraries disabled (/Zl, or in Fortran, /libdir:noauto). Your DLL project specifies, by default, multithread DLL.
The solution is to make sure that all objects and libraries are compiled with the same setting for run-time libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
World War III could start. Or you could get subtle run-time errors due to having two run-time libraries loaded.
Your static library was built with one choice for run-time libraries (probably multithread debug) and did not have the "OBJCOMMENT directives" for default libraries disabled (/Zl, or in Fortran, /libdir:noauto). Your DLL project specifies, by default, multithread DLL.
The solution is to make sure that all objects and libraries are compiled with the same setting for run-time libraries.
Your static library was built with one choice for run-time libraries (probably multithread debug) and did not have the "OBJCOMMENT directives" for default libraries disabled (/Zl, or in Fortran, /libdir:noauto). Your DLL project specifies, by default, multithread DLL.
The solution is to make sure that all objects and libraries are compiled with the same setting for run-time libraries.
Ah ah thanks Steve... The scare tactics (re: WWIII) worked and I'll heed this warning. I am not sure however I fully grasp your answer. Are you suggesting that I should build my static library with the Debug Multithread DLL option? (for my Debug configuration, and I assume that for my release configuration I should use the Multithread DLL option)
Thanks in advance for clarifying this.
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your static library is all Fortran, then build it with Libraries > Disable Default Library Search Rules. This is usually the default for a Fortran static library project. Then it will rely on the libraries specified by your DLL project.
Otherwise, then, yes, I am suggesting building the static library with the Multithreaded DLL (Debug or not, as appropriate), to avoid coming down with MCLS (Multiple C Library Syndrome.)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page