PDA

View Full Version : Rebuilding freeglut_static.lib



Beau Williamson
01-19-2009, 02:55 PM
I very new to OpenGL, and programming on Windows under Visual Studio C++ Express so I apologize in advance if my questions are really elementary for many of you.

I'm going through all the sample projects in the OpenGL Superbible (4th Edition). I got tired of having to set the Project properties to Ignore LIBC.lib (due to the fact that the supplied freeglut_static was built single threaded and hence wants to use LIBC.lib). Therefore, I downloaded the freeglut-2.4.0 source and followed the README.win32 instructions to rebuild freeglut_static.lib so it would be MultiThreaded (/MT) to avoid the problem with LIBC.lib not being found.

While I no longer get any error messages about LIBC.lib, I do get the following Warning from the linker:

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

I know I'm being really picky here but I'd like to figure out how to rebuild freeglut_static.lib so it doesn't generate the above Warning. Can anyone help me find the source of the above Warning? I'm sure it's something in the newly rebuilt freeglut_static.lib but what is causing this?

I'm still learning Visual Studio so I'm not sure exactly what to do to fix this. (I'm assuming my problem is related to how I rebuilt the library in Visual Studio C++ 2008 Express.)

ZbuffeR
01-19-2009, 03:20 PM
Nothing to do with opengl, just copypasting the error message in any web search will give you this interesting page :
http://msdn.microsoft.com/en-us/library/aa267384.aspx

Beau Williamson
01-19-2009, 03:53 PM
I see what's going on. There's two versions of freeglut_static.lib Release and Debug. I installed the Release version. However, I built a Debug version of the "Simple" project against the Release version of the library. That's seems to be why I get the Warning. If I do a Release build of "Simple", I don't get the Warning message because both the freeglut_static.lib and Simple are using LIBCMT.

Thanks.

yooyo
01-19-2009, 04:23 PM
Create several static versions of freeglut, each one with different compiler runtime library settings (multithreaded, multithreaded DLL, singlethreaded, singlethreaded DLL) and save them all.
Later in your projects just choose which runtime library settings you want to use and link proper lib file.

bugmenot
06-26-2010, 02:30 AM
here you can find a simple explanation to the the problem too along with a precompiled lib that will work for you:

http://www.taekwondo.org.il/system/glutvc2005.html