Open ghost opened 8 years ago
Are you using the pre-built Windows binaries? The bundled Visual Studio projects? cmake? Do you see this warning for glewinfo and visualinfo?
Need more information on this one.
I realize this is old, but I've had a very similar issue (but with LIBCMT instead of MSVCRT), and did some digging.
If I've understood things correctly, the warning comes when an application is built with one version of the C runtime library (CRT), and a dependent library was built with support for another. Looking at the vcxproj files, GLEW specifies the "MultiThreaded" version (/MT) for release libraries builds, which gives a dependency on libcmt.lib, and the "MultiThreadedDebugDLL" version (/MDd) for debug builds, which gives a dependency on msvcrtd.lib (and a corresponding dll).
If your application then links with e.g. glew32_s.lib, built in release, while it has the /MTd flag set (corresponding to "MultiThreadedDebug"), it will link with both libcmt.lib (because of glew32_s.lib), and with libcmtd.lib (because of the flag in your build). If you don't want the warnings, there are 3 possible ways to solve this:
I would prefer option 2, but it seems that GLEW is tricky to build (or at least to generate the needed code for) on Windows.
Another option could be to supply more binaries in the releases:
Some resources:
When I build program in x64 debug mode, the output console shows "warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs", when I build the same program in x64 release mode, no warning shows. So how to solve this problem ?