1

I'm using Visual C++ 2008 Express to create a static C library.

When I go to use the static library in another project, I get these messages:

static_library.lib(strings.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance 1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification 1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

What do I need to do to my static library project to resolve these issues? I've been reading documentation and not getting a clear indication of what I need to do to resolve this.

I'm not looking to make changes to the project USING the static library (unless I've made a mistake in that). I want this static library .lib to work as naturally as other libraries without special project treatment.

B. Nadolson
  • 2,988
  • 2
  • 20
  • 27
  • For the MSVCRT conflict here's the resolution: http://stackoverflow.com/questions/3007312/resolving-lnk4098-defaultlib-msvcrt-conflicts-with – KrisSodroski Jun 12 '13 at 18:24
  • The library was compiled with compile settings that are incompatible with the settings used in your project that links the library. Particularly the LNK4098 warning is one you should not ignore, it is very likely to cause runtime crashes. The setting that matters is C/C++, Code Generation, Runtime library. The library was built with /MD, your program is using /MT. Make them the same. – Hans Passant Jun 12 '13 at 18:43
  • In the static library project, should I use /MD or /MT? I'm not making a DLL and /MD implies a .dll, yet I've heard that /MD should be used (??) – B. Nadolson Jun 12 '13 at 18:46

0 Answers0