Forums

Full Version: Trouble compiling on Windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I took another shot at compiling VDrift on Windows using the tutorial here http://wiki.vdrift.net/Compiling#Windows I followed all the steps (except for install locations since I keep my compiling tools in their own folder) but building fails with the message "sh: scons: command not found".

I installed all applications listed on that page. mSYS found my MinGW install and linked with it, while scons found my Python install and linked with it too. Does anyone know what could be causing this issue in that case?
I wrote a batch script some time ago.
build_vdrift.bat:
Code:
@echo off
echo.
echo --VDrift Windows compilation script--
echo.
echo Make sure you're running this from your VDrift folder, like so:
echo tools\win\bin\build_vdrift.bat

echo.
call scons release=1

echo.
echo Copying files:
xcopy /d build\vdrift.exe .
xcopy /d tools\win\dll\*.dll .

echo.
echo Make sure you check get the VDrift data!  See:
echo http://wiki.vdrift.net/Getting_the_development_version#Checking_out_the_data
You have to place it in tools\win\bin
And run from vdrift directory. I am going to add it to the Wiki.
Thanks... that will make compiling easier than using the mingw console each time. It still doesn't fix my issue however. Now the error is " 'scons' is not recognized as an internal or external command, operable program or batch file."

I wonder if it might be scons not being detected by mingw, although it linked correctly with python. Is there anything that hasn't been mentioned in the wiki on how scons must be linked with mingw? Scons seems to install itself in the Python folder, which is next to the Mingw and msys folders.
Please check your PATH Environment Variable:
http://www.computerhope.com/issues/ch000549.htm
It should contain the python and python scripts path:
C:\Python26;C:\Python26\Scripts;
Thanks, that fixed this issue. Should add the steps to the wiki, if it doesn't require more registration to edit it.

I'm having another issue when attempting to compile now. It keeps failing with this message:

Code:
Taoki@TAOKI-PC /d/VDrift/VDrift_engine_SVN
$ sh tools/win/bin/build_vdrift.sh
--VDrift Windows compilation script--

Make sure you're running this from your VDrift folder, like so:
sh tools/win/bin/build_vdrift.sh


scons: Reading SConscript files ...

scons: *** MSVC error while executing C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat with args amd64 (error was The specified configuration type is missing.  The tools for the configuration might not be installed.)
File "D:\VDrift\VDrift_engine_SVN\SConstruct", line 343, in <module>
Scons can't find the gcc compiler and is using msvc instead. Add the path of your mingw installation to your PATH environment variable: C:\MinGW\bin;
NaN Wrote:Scons can't find the gcc compiler and is using msvc instead. Add the path of your mingw installation to your PATH environment variable: C:\MinGW\bin;

Done that, but I still get the same issue Sad GCC does appear to be located in MinGW, including a gcc.exe and g++.exe in MinGW\bin.
Are you able to run gcc in command prompt?
Open a new CMD prompt by choosing START, RUN, cmd, OK.
Enter:
Code:
g++ -v
The last line should be something like: "gcc version ..."
Yeah, that does appear to work.

Code:
D:\VDrift\VDrift_engine_SVN>g++ -v
Reading specs from D:/Tools/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

D:\VDrift\VDrift_engine_SVN>
Looks like scons is ignoring mingw if there is a msvc compiler installed. :?
I committed my project file \tools\win\vdrift.cbp.
Get a Code::Blocks nightly: http://forums.codeblocks.org/index.php/board,20.0.html
Compile from codeblocks.
Thanks! Codeblocks finally compiles it Big Grin It still fails after a while, although this looks like a general code issue. This is the log:

Code:
......
Compiling: ..\..\src\fbtexture.cpp
Compiling: ..\..\src\font.cpp
Compiling: ..\..\src\forcefeedback.cpp
D:\VDrift\VDrift_engine_SVN\src\forcefeedback.cpp:1:25: definitions.h: No such file or directory
Process terminated with status 1 (0 minutes, 52 seconds)
1 errors, 68 warnings
Sorry, forgot about this one. Will update vdrift.cbp asap.
You can create it manually and put it into include folder.
It has to look like this:
Code:
#ifndef _DEFINITIONS_H
#define _DEFINITIONS_H
#define SETTINGS_DIR ".vdrift"
#define DATA_DIR "./data"
#define VERSION "2010-02-03-full"
#define REVISION "2566:2579M"
#endif
Yep... it compiles all the way now. I'll try to see if I can understand and contribute to the code next. Should also add this info to the wiki page, so other people won't go through trouble getting it working.

I also have an off-topic question. Since I'm not seeing any other important file being generated by the compiler (except the dlls), does vdrift.exe also contain the gamecode, alongside the engine?
Yes, vdrift.exe contains all the game code. The only dlls you need are the ones in \tools\win\dll. So if you want to test your fresh compiled exe, simply put it in the game folder.