07-08-2007, 04:56 AM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
Fixing Win32 build with SCons
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,
from include\game.h:40,
from src\vamos\body\Car.cc:36:
include/shader.h:14: error: `GLhandleARB' does not name a type
I'm not sure what GL header I need to include to get this symbol. Joe, any suggestions?
So here's how to compile VDrift with SCons on Windows. - Get TortoiseSVN and use it to check out VDrift SVN.
- Get Python for Windows and install.
- Get SCons for Windows and install. It should find your Python install location and install SCons there.
- Add the Python install location (i.e. C:\Python24) to your Windows PATH environment variable. To do this, right click My Computer, select Properties, go to Advanced tab, click Environment Variables button.
edit: also add the Dev-C++ bin directory to your PATH. Usually this is C:\Dev-Cpp\bin.
- Now, open a command prompt (Start -> Run... cmd.exe). Change directories (cd) to the directory where you checked out VDrift SVN.
- Now just type scons and away it goes.
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)
|
|
07-08-2007, 03:25 PM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
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...
|
|
07-09-2007, 03:45 PM,
|
|
mak77
Junior Member
![*](images/star.png) ![*](images/star.png)
|
Posts: 24
Threads: 1
Joined: Mar 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...
|
|
07-09-2007, 05:15 PM,
|
|
mak77
Junior Member
![*](images/star.png) ![*](images/star.png)
|
Posts: 24
Threads: 1
Joined: Mar 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...
|
|
07-09-2007, 05:32 PM,
|
|
mak77
Junior Member
![*](images/star.png) ![*](images/star.png)
|
Posts: 24
Threads: 1
Joined: Mar 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...
|
|
07-09-2007, 05:48 PM,
|
|
mak77
Junior Member
![*](images/star.png) ![*](images/star.png)
|
Posts: 24
Threads: 1
Joined: Mar 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
|
|
07-09-2007, 05:54 PM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
Do you know how to use gdb? It's a debugger. I think Dev-C++ includes it. You can enable debugging symbols with
Then just run
and it should let you then type run (or just r) at the gdb prompt to run. Then when it crashes (window disappears), just type backtrace (or just bt) and it will show you the stack trace where the program crashed.
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.
|
|
07-09-2007, 06:23 PM,
|
|
mak77
Junior Member
![*](images/star.png) ![*](images/star.png)
|
Posts: 24
Threads: 1
Joined: Mar 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 ![Sad Sad](https://www.vdrift.net/Forum/images/smilies/sad.gif) i will try other experiments on the next days but now i can't go on
I also found these links for glext
http://ati.amd.com/developer/sdk/radeonS...rog3D.html
http://developer.nvidia.com/object/nvidi...specs.html
opengl on windows are not evolving, but these extensions are...
|
|
07-10-2007, 03:02 AM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
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. ![Smile Smile](https://www.vdrift.net/Forum/images/smilies/smile.gif) I can run the vdrift.exe file now, if I copy the dll's to the same directory where vdrift.exe is run. It then tries to make me a VDrift.config but fails because I didn't have any data checked out. Oops! :oops:
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.
|
|
|