From: Larry E. R. <hyd...@ya...> - 2006-09-22 20:41:37
|
I am not a big fan of #pragma either. Boost does this to force the loading of the correct boost_someting_version.lib and it can be REALLY annoying because is means you cannot change the name of your libs or boost fails to work. (at least on *nix you can soft link, but I'm still not a big fan) Makes changing boost versions tedious because you have to go hack all your makefiles instead of just silently replaceing the boost libs. (since they end up with the version number in the name) Anything that isn't ANSI C should be frowned on heavily in my Not So Humble cross-platform experiance. #pragma once IS easier to write than #ifndef foo #define foo #endif but dangit....... one is cross platform on ALL compilers and one puts you at the mercy of the compiler writers. I also agree with the _WIN32 comments. WIN32 is NOT always defined, but _WIN32 should be. (WIN_LEAN_AND_MEAN can replace WIN32 sometimes...) Larry E. Ramey Joe Krahn <kr...@ni...> wrote: My take on lib pragmas is that they are underhanded and non-standard, and should never be used. I once got severely confused by trying to edit and link against a debug library, when a lib pragma was pulling in a non-debug library without my knowledge. However, I now get feeling that MS-Win32 uses these library pragmas as a hack to substitute for having the actual library file define dependencies. My feeling now is that maybe they are needed due to Win32's design. If so, maybe there should be a #define option to exclude them. My guess is that we can assume that all Win32 compiler accept lib pragmas, or at least ignore them without errors. For things that are universal to MS-Windows, I think it is better just to check for "_WIN32", which should be predefined on all Win32 compilers, even Win64 (which makes it a bit funny that MS chose _WIN32). So, I propose that all checks for compiling under MS-Windows use "_WIN32". The other pre-defines that relate to specific compilers should only be checked for issues specific to that compiler. Joe Fay John F Dr CTR USAF AFSEO/SK wrote: > I just found why I didn't get an error ... In "freeglut_std.h" on lines > 85-93 we find some pragmas that are defined only for "_MSC_VER" or > __WATCOMC__" and not for "_WIN32_WCE". These pragmas pull in the > libraries "winmm.lib", "user32.lib", "gdi32.lib", "opengl32.lib", and > "glu32.lib". > > Should we add some more conditions under which to bring these libraries > in automatically? Or should we try taking them out? > > John F. Fay > Technical Fellow, Jacobs/Sverdrup TEAS Group > 850-883-1294 > joh...@eg... > > -----Original Message----- > From: Fay John F Dr CTR USAF AFSEO/SK > Sent: Friday, September 22, 2006 12:33 PM > To: 'FreeGLUT developers list' > Subject: RE: [Freeglut-developer] Linking problems on Windows > > Andreas, > > Interestingly, I just took the "gdi32.lib" reference out of my > list of libraries (in the MSVC project settings) for the Callback Maker > demo--I couldn't find a "winmm.lib" in the list at all--and it compiled > and linked beautifully. Can you tell me what link errors you got? > > John F. Fay > Technical Fellow, Jacobs/Sverdrup TEAS Group > 850-883-1294 > joh...@eg... > > -----Original Message----- > From: fre...@li... > [mailto:fre...@li...] On Behalf Of > Andreas Volz > > Sent: Tuesday, September 19, 2006 3:45 PM > To: fre...@li... > Subject: Re: [Freeglut-developer] Linking problems on Windows > > > > I compiled freeglut with -DFREEGLUT_STATIC. But I missed to add this > define to my example. Now it works (nearly). There's still the same > problem as with (real) GLUT. I need to link against -lfreeglut -lglu32 > > -lopengl32 -lwinmm -lgdi32 in exact this order to get no unresolved > symbols. I tried to compile freeglut with -lwinmm and -lgdi32 to avoid > this, but no change. > > I don't like linking all my apps to -lwinmm and -lgdi32. This troubles > all my autotool scripts that work for Linux. So why is this needed on > windows and how could I avoid it? > > regards > Andreas > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Freeglut-developer mailing list Fre...@li... https://lists.sourceforge.net/lists/listinfo/freeglut-developer --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less. |