C++ Question LNK4098 error that happened suddenly?

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
I was adding the OrbiterSoundSDK35.h/lib to my project so I can add some custom sounds. That went fine. Then I tried to add a flag for setting the thruster level to 0 if the engine state is 0. I was having trouble with that so I wanted to figure it out later. I deleted that little snippet so I can actually play with my ship. Suddenly I get this warning and every time that I start my engines (along with the sounds involved) the sound does not work. Here is the warning.

Code:
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

I read somewhere it has something to do with conflicts with the libraries. I haven't added any new libraries or that nature so I don't see what happened. Can anyone point me into fixing it?
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Add Libcmt.lib to the "Ignore Specific Libraries" option.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Yeah that got rid of the warning. I went ahead and replaced the OrbiterSoundSDK35.h file because when I opened it compared to the default one, it had a little extra. I guess something got deleted, but I don't remember doing that. Thanks.
 

orb

O-F Administrator,
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
I read somewhere it has something to do with conflicts with the libraries. I haven't added any new libraries or that nature so I don't see what happened.
You didn't need to add it. LIBCMT is a default C runtime library if you're linking project statically ("Multi-threaded /MT" Runtime Library). In this case its use is forced by OrbiterSoundSDK35.lib.

By default, new projects or OrbiterSDK samples use dynamically linked C/C++ libraries ("Multi-threaded DLL /MD" (MSVCRT, MSVCPRT) or "Multi-threaded Debug DLL /MDd" (MSVCRTD, MSVCPRTD) Runtime Library), and hence the conflict (since they have the same symbols exported as LIBCMT and LIBCPMT).
 
Top