Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ibrahim_K_
New Contributor I
278 Views

warning LNK4098: defaultlib 'LIBCMT' conflicts when changed the project folder

I started receiving this dreaded warning. I am linking VC++ project with Fortran static library. In 2020 I moved my project to a new folder. But till now, I did not change the library information till recently. I was using old static library I created last year when I tried to use the version compiled and created with the C+ project, I started getting this warning. I am still using VS2017. I compared all the options and tied the suggestion I found here. None worked. As Steve suggested I really do not want to overlook this.

I am attaching the screens from old and new versions of the project as well as the log from the new Solution.

Any suggestion and help would be greatly appreciated.

I. Konuk

0 Kudos
3 Replies
Ibrahim_K_
New Contributor I
278 Views

I added /VERBOSE switch to the linker. I obtained a big output. Microsoft states that

For example, when your executable uses the multi-threaded, non-debug run-time libraries, the list reported should include LIBCMT.lib, and not LIBCMTD.lib

But looking at the log output from linker, it is searching the right library. I see the lines:

Searching C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x86\LIBCMT.lib:

and not the second one:

Processed /DISALLOWLIB:libcmtd.lib

I would appreciate if you point out to any other library linker is searching for which it should not.

I. Konuk

 

 

Steve_Lionel
Black Belt Retired Employee
278 Views

In the Fortran project, property Fortran > Command Line, remove "/libs:static" from "Additional Options". The C++ project is using the DLL libraries and you want the Fortran project to do the same. What happens is that you have specified the DLL libraries but then overrode that with Additional Options.

Ibrahim_K_
New Contributor I
278 Views

Steve:

A big THANK YOU again. Thank you also for your prompt response.

Best regards;

I. Konuk

Reply