The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Fixing Win32 build with SCons - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4) +--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9) +--- Thread: Fixing Win32 build with SCons (/showthread.php?tid=719) |
Fixing Win32 build with SCons - thelusiv - 07-08-2007 I've gotten SCons almost compiling VDrift on my Windows XP VM. I also added all the necessary header files and dll files to the project, and changed a few things to accommodate SCons on win32, including build improvements and some modifications to headers. All this is checked in to VDrift trunk r1752. I say it's almost compiling because I'm getting an error: Code: In file included from include\graphics.h:29, So here's how to compile VDrift with SCons on Windows.
Those of you running Windows, please try it out and tell me if I've missed some instructions. It does not work yet due to the shaders.h problem mentioned above, but you can at least see if I got the instructions right...and hopefully that problem will be fixed soon anway. 8) - joevenzon - 07-08-2007 Be aware that the scenegraph branch adds opengl functionality that needs to be ported to windows (the opengl headers for windows don't include any recent extensions, so there's a windows-specific way to get them). That said, I don't know what's causing the message you're getting. Maybe grep through your linux headers...? - thelusiv - 07-08-2007 Alright I have done some research and turns out that there are no GL headers newer than 1.1 for Windows, so it's more of a pain to get newer extensions working on that platform. The solution to the above problem was to use SGI's glext.h, which is now included in the tools/win/include dir in SVN, as noted in this handy GL extensions article on GameDev.net (thanks for the link Joe). With this change and a few other little changes to Win32 specific code SCons now builds for me all the way to the linker line, where it fails with Code: C:\Dev-Cpp\bin\..\lib\gcc\wingw32\3.4.2\..\..\..\..\wingw32\bin\ld.exe: cannot find -lGL Oh, and one other thing I forgot to mention about building with SCons is that you have to change line 65 of SConstruct to point to your Dev-C++ installation's bin directory (or wherever your gcc.exe and g++.exe are if you don't have Dev-C++). I haven't figured out a good way to find this automatically... - thelusiv - 07-09-2007 I fixed that problem, it should be linking to opengl32.dll and glu32.dll which Windows provides. This is checked in to the latest SVN but there are some more issues with OpenGL extensions in shaders.cpp and graphics.cpp. I'll try to fix them soon. It almost finishes linking now. Only a few symbols are still missing... - mak77 - 07-09-2007 iìm trying to compile on XP, your instructions are ok, there is some problem with undefined (as you said) looking around on Internet i found GLEW that COULD be the solution so solve these extension problems, but i'm not too good in graphic development, so take a look http://glew.sourceforge.net/install.html Quote:The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris. I've been able to fully compile vdrift source using glew... don't know if it works yet... - thelusiv - 07-09-2007 Hmm, that is certainly tempting, as it seems much more flexible than this method, which was what I was planning on doing: http://www.gamedev.net/reference/programming/features/oglext/page3.asp What do you think, Joe? - mak77 - 07-09-2007 it compiles changing only a few things... change #include glu.h and gl.h to #include glew.h (maybe only on windows with a #ifdef) remove glext.h add SDLMain GLEW32 MingW32 to libs add glew32.dll and glew.h to window build dir.. and it compiles without errors... i'll try this compile now... - thelusiv - 07-09-2007 Don't you have to add some code before it will run though? I was reading the basic usage page and it says there's a few things that have to be done...right? If you want to finish up coding that, and get it ready, I'll give you SVN commit access and you can check it in. - mak77 - 07-09-2007 i haven't changed anything, it was only an experiment, i have added an ifdef for header inclusion, and modified libs list... added missing .h and .dll file. it compiles, i have copied the exe into the old vdrift folder but it complains for the lack of skin reference in config... don't have investigated too much on how this works, but it catches all opengl extension calls, at least during compile... - thelusiv - 07-09-2007 It always complains about the skin name not being in the config file. The settings class is overdue for a rewrite. That's my next project... ![]() - mak77 - 07-09-2007 Found config file C:\Users\MaK77/VDrift/controls. Found config file C:\Users\MaK77/VDrift/VDrift.config. Version of game: 2007-07-09-full Skin name not found in config file... opens a window, and close immediately... i'm on Vista, so this could not be the best windows environment to test... Probably glew compiles but needs some initialization, as you said - thelusiv - 07-09-2007 Do you know how to use gdb? It's a debugger. I think Dev-C++ includes it. You can enable debugging symbols with Code: scons debug=1 Code: gdb.exe vdrift.exe edit: You will probably have to type the full path to gdb.exe, like C:\Dev-Cpp\bin\gdb.exe. I'm thinking about adding a step to the SCons compilation instructions that tells users to add C:\Dev-Cpp\bin to their PATH in Windows as well as Python. This would be better than telling them to modify the SConstruct file to point to the right path. On that note, the docs should mention that you can use cygwin or just mingw instead of fully installing Dev-C++, since it's not actually used for compilation anyway. - mak77 - 07-09-2007 it's not so easy, i'm compiling on a virtual machine (no 3D acceleration) and testing on a real machine without compiler... hwv i get a GL Version missing error from GLEW, i read that it needs to be initialized after the gl window/context has been created, and probably it needs different code to draw non supported ext functions... things are moving far from me ![]() I also found these links for glext http://ati.amd.com/developer/sdk/radeonSDK/html/info/Prog3D.html http://developer.nvidia.com/object/nvidia_opengl_specs.html opengl on windows are not evolving, but these extensions are... - joevenzon - 07-09-2007 I think the method that was used previously to get the windows version to compile is probably the easiest. Why not just use that? You have to get a function pointer to the function you want, but that's not too hard. You should be able to find tutorials all over with google, and you can look at the existing code to get an idea for how to use it. That being said, if you guys find some other way to do it, I'm fine with that too. - thelusiv - 07-10-2007 So it seems GLEW is a pretty good idea, it makes resolving those symbols pretty simple. SVN r1763 has simple support for GLEW and now it's finally compiling on Windows! Thanks for the suggestions, mak77. ![]() So I checked it out, and now, running vdrift.exe gives me errors saying that the required opengl extensions are not available. This is a good sign, since it means if I run it on a computer with a real graphics card (instead of just VMWare) it might actually run. I might have a computer I can use to test it, but if somebody else has a real Windows install on their computer and wants to test it out, please do. I'll try to write some instructions on the Wiki explaining how to use SCons to compile VDrift for Windows soon also. |