Difference between revisions of "HowTo:VCPP Compiling"
m (→Visual C++ 8.0(2005 Express) plus the Code::Blocks IDE) |
(update bug GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F) |
||
(28 intermediate revisions by 5 users not shown) | |||
Line 9: | Line 9: | ||
First, [[HowTo:Checkout_SVN|check out the SVN modules]]. | First, [[HowTo:Checkout_SVN|check out the SVN modules]]. | ||
− | When using another module (e.g. <code>vegastrike</code>, <code>vssetup</code>), they should be placed in the directory above <code>vega- | + | When using another module (e.g. <code>vegastrike</code>, <code>vssetup</code>), they should be placed in the directory above <code>vega-vc</code> in the directory tree. |
− | For example, when you want to checkout Vegastrike, you may make a <code>Vegastrike</code> directory and from there, checkout <code>vega- | + | For example, when you want to checkout Vegastrike, you may make a <code>Vegastrike</code> directory and from there, checkout <code>vega-vc9</code> for all Visual C++ editions, <code>vegastrike</code>, <code>data</code> ALL from this directory. |
* <code>vegastrike/</code> - base directory. | * <code>vegastrike/</code> - base directory. | ||
* <code>vegastrike/vegastrike/</code> - The stuff from the vegastrike module (the actual code) | * <code>vegastrike/vegastrike/</code> - The stuff from the vegastrike module (the actual code) | ||
− | * <code>vegastrike/vega-proj/</code> - The project files. (VISUAL C++ 6.x) | + | * <code>vegastrike/vega-proj/</code> - The project files. (VISUAL C++ 6.x) Deprecated |
− | * <code>vegastrike/vega-vc7/</code> - The project files. (VISUAL C++ 7.x) | + | * <code>vegastrike/vega-vc7/</code> - The project files. (VISUAL C++ 7.x) Deprecated |
− | * <code>vegastrike/vega-vc8/</code> - The project files. (VISUAL C++ 8.0) | + | * <code>vegastrike/vega-vc8/</code> - The project files. (VISUAL C++ 8.0) Deprecated |
− | * <code>vegastrike/win32/</code> - The newer version of data. Binaries will be compiled into the bin directory, so it should be here in the tree if you do not want to edit project settings. | + | * <code>vegastrike/vega-vc9/</code> - The project files. (VISUAL C++ 9.0 and higher) |
+ | * <code>vegastrike/win32/</code> - The newer version of data. Until the change is made in the Vegastrike project setting binaries will be create in vega-vc9/Release or vega-vc9/Debug. <strike>Binaries will be compiled into the bin directory, so it should be here in the tree if you do not want to edit project settings.</strike> | ||
Here is a list of every project included for SVN compilation that is used: | Here is a list of every project included for SVN compilation that is used: | ||
Line 25: | Line 26: | ||
* vssetup (<code>Setup.exe</code>) - The main Setup program--doesn't change much, so you can use the binary directly from SVN. | * vssetup (<code>Setup.exe</code>) - The main Setup program--doesn't change much, so you can use the binary directly from SVN. | ||
− | ==Visual C++ | + | ==Visual C++ 11.x (Visual Studio Express 2012)== |
− | |||
− | + | {{Fixme}} Write Me - Until specific instructions are written by someone knowledgeable, follow information for previous versions and supplement it with up to date information about compiling from the forums. | |
− | |||
− | |||
− | + | ==Visual C++ 10.0 (2010 Express)== | |
− | + | {{Fixme}}Currently there are no working project files for VC10. This will be changing in the near future so please be patient. For now just copy everything from the <code>trunk/vega-vc9</code> folder into a newly created vega-vc10 folder and convert the VC9 project files. | |
+ | You can download a copy of VC10 Express from [http://www.microsoft.com/express/download/ Download Visual Studio Express]. | ||
+ | If you encounter any issues post a new topic in the [http://forums.vega-strike.org/viewforum.php?f=5 Compiling Problems] forum. | ||
==Visual C++ 9.0 (2008 Express)== | ==Visual C++ 9.0 (2008 Express)== | ||
− | This is likely only for Windows XP SP3 and Vista (so probably not Windows 2000). Apparently no Platform SDK is necessary. Note that it is required that the local file and directory structure is identical to the one on SVN. You need to checkout the following: <code>trunk/vegastrike</code>, <code>trunk/vega- | + | This is likely only for Windows XP SP3 and Vista (so probably not Windows 2000). Apparently no Platform SDK is necessary. Note that it is required that the local file and directory structure is identical to the one on SVN. You need to checkout the following: <code>trunk/vegastrike</code>, <code>trunk/vega-vc9</code>, <code>trunk/win32</code>. If the above is wrong you will need to download the 2008 SDK or higher. |
# [http://www.microsoft.com/express/download/ Download Visual C++ 2008 Express Edition]. | # [http://www.microsoft.com/express/download/ Download Visual C++ 2008 Express Edition]. | ||
# Make sure you are logged on as admin. Otherwise the VC++ 2008 EE installation will fail. Run the installer, uncheck all the boxes on each page if you want a lighter download. It will do everything on it's own then ask to reboot. | # Make sure you are logged on as admin. Otherwise the VC++ 2008 EE installation will fail. Run the installer, uncheck all the boxes on each page if you want a lighter download. It will do everything on it's own then ask to reboot. | ||
− | # To | + | # To update for Python 2.7 you will need to download the latest 2.7 source release: [http://www.python.org/download/ Download latest source Python 2.7] |
− | # Compile Python using their <code>Python-2. | + | or directly [http://www.python.org/download/releases/2.7.6// www.python.org/download/releases/2.7.6] |
− | + | # Compile Python using their <code>Python-2.7.1\PCbuild\pcbuild.sln</code> solution file. Make sure it works (<code>python.exe</code> starts up). | |
− | # Substitute the corresponding Python 2. | + | # Substitute the corresponding Python 2.7 files from <code>Python-2.7.1\PCbuild</code> and <code>Python-2.7.1\include</code>. Python also requires a <code>pyconfig.h</code> inside your <code>vega-vc9\include\python</code>, you can copy it from <code>Python-2.7.1\PC</code>. |
− | # In VC++ 2008 EE, update the vegastrike project properties: in configuration properties -> linker -> input -> additional dependencies, change the python version to 2. | + | # In VC++ 2008 EE, update the vegastrike project properties: in configuration properties -> linker -> input -> additional dependencies, change the python version to 2.7. (It should be the last one in the list.) |
+ | # Apply the <code>VCExpress.diff</code> to fix the resource file for use with Visual C++ Express. | ||
# Vegastrike should now build normally. | # Vegastrike should now build normally. | ||
− | ==Visual C++ 8.0 (2005 Express)== | + | |
+ | *Update --[[User:Ezee|Ezee]] 19:39, 22 February 2014 (UTC) | ||
+ | |||
+ | I had a lot of troubles to compile , link and run the program ! | ||
+ | |||
+ | So this is how to obtain a working version of Vegastrike 0.5.2 from the SVN | ||
+ | |||
+ | ( with turtoise ) | ||
+ | |||
+ | YOU MUST CREATE FIRST THE EMPTY FOLDERS IN YOUR COMPUTER : | ||
+ | |||
+ | The idea is to recreate the tree of the svn . | ||
+ | |||
+ | *1_Create a folder trunk | ||
+ | *2_Create a folder trunk\win32 | ||
+ | *3_Create a folder trunk\data | ||
+ | *4_Create a folder trunk\vega-vc9 | ||
+ | *5_Create a folder trunk\vegastrike | ||
+ | |||
+ | from there , you are ready to check out the SVN . | ||
+ | |||
+ | *1- Select your folder vega-vc9 | ||
+ | Right-click and use tortoise -> checkout with : | ||
+ | http://svn.code.sf.net/p/vegastrike/code/trunk/vega-vc9 | ||
+ | |||
+ | *2- Select your folder vegastrike | ||
+ | Right-click and use tortoise -> checkout with : | ||
+ | http://svn.code.sf.net/p/vegastrike/code/trunk/vegastrike | ||
+ | |||
+ | *3- Select your folder data | ||
+ | Right-click and use tortoise -> checkout with : | ||
+ | http://svn.code.sf.net/p/vegastrike/code/trunk/data | ||
+ | |||
+ | *4- Select your folder win32 | ||
+ | Right-click and use tortoise -> checkout with : | ||
+ | http://svn.code.sf.net/p/vegastrike/code/trunk/win32 | ||
+ | |||
+ | *5-There will be errors if you try to compile , caused by Boost 1.45 . | ||
+ | ( version 0.5.2 of vegastrike contain only boost 1.53 ) | ||
+ | So checkout also the Boost 1.45 in the same folder than the 1.53 ( in vegastrike/Boost ) | ||
+ | http://svn.code.sf.net/p/vegastrike/code/branches/vegastrike_0_5_1/vegastrike/boost/1_45 | ||
+ | |||
+ | *6-There is bug with a #define and GL_TEXTURE_CUBE_MAP_SEAMLESS | ||
+ | Solution is [http://forums.vega-strike.org/viewtopic.php?f=5&t=18590&p=135450#p135450 in the forum ] | ||
+ | |||
+ | Now your solution vc9 should be ok . | ||
+ | BUT THE .EXE WILL BE BUILD IN "\trunk\vega-vc9\Release" or "\trunk\vega-vc9\Debug" | ||
+ | by default . | ||
+ | |||
+ | ( you won't be able to run or debug the game , step into etc ... ) | ||
+ | |||
+ | So now , go to your project options , in " Linker" , change the output path like this : | ||
+ | " D:\program\trunk\win32\bin\$(ProjectName).exe " | ||
+ | |||
+ | ( change D:\program\trunk\ by your path :wink: ) | ||
+ | |||
+ | Almost ended . | ||
+ | |||
+ | You need to copy the content of your folder "data" in your folder win32\bin | ||
+ | DON'T FORGET TO UNZIP THE PYTHON 2.7 rar in \win32\bin ! | ||
+ | |||
+ | GOOD ! | ||
+ | Enjoy your new Vegastrike programming environment ! | ||
+ | |||
+ | ==Visual C++ 8.0 (2005 Express)(deprecated)== | ||
+ | This is left here in case someone wants to attempt a working VC8 build | ||
Warning: VC8 requires a big download off Microsoft's site. | Warning: VC8 requires a big download off Microsoft's site. | ||
Line 70: | Line 136: | ||
# Checkout the Vegastrike project as described earlier. | # Checkout the Vegastrike project as described earlier. | ||
# Open the "vega-vc8" project using the IDE. | # Open the "vega-vc8" project using the IDE. | ||
− | # The compilation should go for the most part smoothly. If you encounter any problems, please tell us in the [http:// | + | # The compilation should go for the most part smoothly. If you encounter any problems, please tell us in the [http://forums.vega-strike.org/ forum] or specifically on [http://forums.vega-strike.org/viewtopic.php?t=6251 this thread]. |
#* Note that Debug versions will be very slow (I get 5 frames/second on my Pentium3 1GHz machine using debug VS). | #* Note that Debug versions will be very slow (I get 5 frames/second on my Pentium3 1GHz machine using debug VS). | ||
− | ==Visual C++ 8.0(2005 Express) plus the Code::Blocks IDE== | + | ==Visual C++ 8.0(2005 Express) plus the Code::Blocks IDE (deprecated)== |
You can download Visual C++ 8.0(2005 Express) after you acquired a vcsetup.exe for Visual C++ 8.0. These are still being offered on some download sites. | You can download Visual C++ 8.0(2005 Express) after you acquired a vcsetup.exe for Visual C++ 8.0. These are still being offered on some download sites. | ||
The main advantages of Visual C++ 8.0 over later versions are that it works for older OSes like Windows 2000 and that there is a vegastrike project file for it, which you can check out from svn as vega-vc8. | The main advantages of Visual C++ 8.0 over later versions are that it works for older OSes like Windows 2000 and that there is a vegastrike project file for it, which you can check out from svn as vega-vc8. | ||
Line 84: | Line 150: | ||
You might want to make a copy of your SVN checkout tree now, to have a clean copy just in case of the code in VegaStrike/ and the project files in vega-vc8/ | You might want to make a copy of your SVN checkout tree now, to have a clean copy just in case of the code in VegaStrike/ and the project files in vega-vc8/ | ||
Start code::blocks, choose VC2005/2008 as default tool chain and import the .sln solution file from vega-vc8 into a workspace. Use the vc8 2005/2008 compiler. | Start code::blocks, choose VC2005/2008 as default tool chain and import the .sln solution file from vega-vc8 into a workspace. Use the vc8 2005/2008 compiler. | ||
− | Double click the vegastrike project so that it is selected in bold. Go to Project/Build options and add /EHsc to vegastrike in other compiler options, remove /W from all projects and choose a warning level you like | + | Double click the vegastrike project so that it is selected in bold. Go to Project/Build options and add /EHsc to vegastrike in other compiler options, remove /W from all projects and choose a warning level you like instead for each compiling option, like /W1 for release and /W3 for a debug build. |
− | I have only tried the Win32 and Win32 debug | + | I have only tried the Win32 and Win32 debug buildsYou will notice that the debug build sets other libraries in linker settings. Basically the left side of the settings is used to include libraries while the right side is used to NOT include the default libraries. Some people have reported that they need to add "/NODEFAULTLIB:libcmt" manually there to exclude libcmt from being linked which results in a conflict.(I also removed /ZI and added insted on the left side /Zi /D_DEBUG to have debug symbols, I'm not sure which is better). |
You need to edit the file Resources.rc to read<br> | You need to edit the file Resources.rc to read<br> | ||
− | + | #include <WinResrc.h> | |
instead of<br> | instead of<br> | ||
− | + | #include "afxres.h" | |
Line 104: | Line 170: | ||
Copying the directories into and over the directory tree of the old install produced a working binary. | Copying the directories into and over the directory tree of the old install produced a working binary. | ||
At least it works as far as I know - I didn't get to test much yet. | At least it works as far as I know - I didn't get to test much yet. | ||
+ | |||
+ | |||
+ | You can debug programs in the VC++ IDE by creating a new project and adding an executable as a subproject. | ||
Enjoy! | Enjoy! | ||
− | ==Visual Studio 7.x== | + | ==Visual Studio 7.x (deprecated)== |
===Compiling from the command line with Visual Studio=== | ===Compiling from the command line with Visual Studio=== | ||
Line 128: | Line 197: | ||
'''NOTE''': You must replace the "<code>C:\vc7</code>" with the directory where you installed visual c++ 7 and replace the "<code>Debug</code>" on the same line with "<code>Release</code>" if you want a release build. | '''NOTE''': You must replace the "<code>C:\vc7</code>" with the directory where you installed visual c++ 7 and replace the "<code>Debug</code>" on the same line with "<code>Release</code>" if you want a release build. | ||
− | ===Compiling with the Visual Studio GUI=== | + | ===Compiling with the Visual Studio GUI (deprecated)=== |
''(This is written with Visual C++ .NET Standard in mind)'' | ''(This is written with Visual C++ .NET Standard in mind)'' | ||
Line 153: | Line 222: | ||
===Note (CVS version as of 14 Nov 2005=== | ===Note (CVS version as of 14 Nov 2005=== | ||
Using the most recent CVS versions (and 2003/Runtime versions from Microsoft) I had to remove /W from the build options '''Project Build Options > Compiler Options > Other Options''' | Using the most recent CVS versions (and 2003/Runtime versions from Microsoft) I had to remove /W from the build options '''Project Build Options > Compiler Options > Other Options''' | ||
+ | |||
+ | ==Visual C++ 6.0 (deprecated)== | ||
+ | As of the end of December, 2005, VegaStrike has dropped compatibility for VC 6 because of the new OGRE rendering engine. | ||
+ | |||
+ | VC 6 users can grab a free copy of VC 8 (Visual Studio 2005 Express) off the Microsoft site, and follow the directions below to compile. | ||
+ | ===Compiling using VC 6=== | ||
+ | Until the OGRE port is finished, VC 6 will still compile, so you can try it if VC8 won't work for you. | ||
+ | |||
+ | First, check out all the modules above. | ||
+ | |||
+ | Then from the MSDEV IDE, open the "vegastrike.dsw" project inside vega-proj, and compile. You will want to use Debug or Release configurations for a standard build. (The Boost 129 builds are permanently broken, and GLUT doesn't work very well as far as I know) | ||
=See Also= | =See Also= |
Latest revision as of 04:22, 24 February 2014
Checkout SVN (Ubuntu Linux) | HowTos | Cygwin Compiling |
Contents
- 1 Compiling under Visual C++
- 1.1 Visual C++ 11.x (Visual Studio Express 2012)
- 1.2 Visual C++ 10.0 (2010 Express)
- 1.3 Visual C++ 9.0 (2008 Express)
- 1.4 Visual C++ 8.0 (2005 Express)(deprecated)
- 1.5 Visual C++ 8.0(2005 Express) plus the Code::Blocks IDE (deprecated)
- 1.6 Visual Studio 7.x (deprecated)
- 1.7 Visual C++ Toolkit 2003
- 1.8 Visual C++ 6.0 (deprecated)
- 2 See Also
Compiling under Visual C++
First, check out the SVN modules.
When using another module (e.g. vegastrike
, vssetup
), they should be placed in the directory above vega-vc
in the directory tree.
For example, when you want to checkout Vegastrike, you may make a Vegastrike
directory and from there, checkout vega-vc9
for all Visual C++ editions, vegastrike
, data
ALL from this directory.
-
vegastrike/
- base directory. -
vegastrike/vegastrike/
- The stuff from the vegastrike module (the actual code) -
vegastrike/vega-proj/
- The project files. (VISUAL C++ 6.x) Deprecated -
vegastrike/vega-vc7/
- The project files. (VISUAL C++ 7.x) Deprecated -
vegastrike/vega-vc8/
- The project files. (VISUAL C++ 8.0) Deprecated -
vegastrike/vega-vc9/
- The project files. (VISUAL C++ 9.0 and higher) -
vegastrike/win32/
- The newer version of data. Until the change is made in the Vegastrike project setting binaries will be create in vega-vc9/Release or vega-vc9/Debug.Binaries will be compiled into the bin directory, so it should be here in the tree if you do not want to edit project settings.
Here is a list of every project included for SVN compilation that is used:
- vegastrike (
Vegastrike.exe
) - VegaStrike binary - vsserver (
vegaserver.exe
) - VegaStrike server - vssetup (
Setup.exe
) - The main Setup program--doesn't change much, so you can use the binary directly from SVN.
Visual C++ 11.x (Visual Studio Express 2012)
FIXME Write Me - Until specific instructions are written by someone knowledgeable, follow information for previous versions and supplement it with up to date information about compiling from the forums.
Visual C++ 10.0 (2010 Express)
FIXME Currently there are no working project files for VC10. This will be changing in the near future so please be patient. For now just copy everything from the trunk/vega-vc9
folder into a newly created vega-vc10 folder and convert the VC9 project files.
You can download a copy of VC10 Express from Download Visual Studio Express. If you encounter any issues post a new topic in the Compiling Problems forum.
Visual C++ 9.0 (2008 Express)
This is likely only for Windows XP SP3 and Vista (so probably not Windows 2000). Apparently no Platform SDK is necessary. Note that it is required that the local file and directory structure is identical to the one on SVN. You need to checkout the following: trunk/vegastrike
, trunk/vega-vc9
, trunk/win32
. If the above is wrong you will need to download the 2008 SDK or higher.
- Download Visual C++ 2008 Express Edition.
- Make sure you are logged on as admin. Otherwise the VC++ 2008 EE installation will fail. Run the installer, uncheck all the boxes on each page if you want a lighter download. It will do everything on it's own then ask to reboot.
- To update for Python 2.7 you will need to download the latest 2.7 source release: Download latest source Python 2.7
or directly www.python.org/download/releases/2.7.6
- Compile Python using their
Python-2.7.1\PCbuild\pcbuild.sln
solution file. Make sure it works (python.exe
starts up). - Substitute the corresponding Python 2.7 files from
Python-2.7.1\PCbuild
andPython-2.7.1\include
. Python also requires apyconfig.h
inside yourvega-vc9\include\python
, you can copy it fromPython-2.7.1\PC
. - In VC++ 2008 EE, update the vegastrike project properties: in configuration properties -> linker -> input -> additional dependencies, change the python version to 2.7. (It should be the last one in the list.)
- Apply the
VCExpress.diff
to fix the resource file for use with Visual C++ Express. - Vegastrike should now build normally.
- Update --Ezee 19:39, 22 February 2014 (UTC)
I had a lot of troubles to compile , link and run the program !
So this is how to obtain a working version of Vegastrike 0.5.2 from the SVN
( with turtoise )
YOU MUST CREATE FIRST THE EMPTY FOLDERS IN YOUR COMPUTER :
The idea is to recreate the tree of the svn .
- 1_Create a folder trunk
- 2_Create a folder trunk\win32
- 3_Create a folder trunk\data
- 4_Create a folder trunk\vega-vc9
- 5_Create a folder trunk\vegastrike
from there , you are ready to check out the SVN .
- 1- Select your folder vega-vc9
Right-click and use tortoise -> checkout with : http://svn.code.sf.net/p/vegastrike/code/trunk/vega-vc9
- 2- Select your folder vegastrike
Right-click and use tortoise -> checkout with : http://svn.code.sf.net/p/vegastrike/code/trunk/vegastrike
- 3- Select your folder data
Right-click and use tortoise -> checkout with : http://svn.code.sf.net/p/vegastrike/code/trunk/data
- 4- Select your folder win32
Right-click and use tortoise -> checkout with : http://svn.code.sf.net/p/vegastrike/code/trunk/win32
- 5-There will be errors if you try to compile , caused by Boost 1.45 .
( version 0.5.2 of vegastrike contain only boost 1.53 ) So checkout also the Boost 1.45 in the same folder than the 1.53 ( in vegastrike/Boost ) http://svn.code.sf.net/p/vegastrike/code/branches/vegastrike_0_5_1/vegastrike/boost/1_45
- 6-There is bug with a #define and GL_TEXTURE_CUBE_MAP_SEAMLESS
Solution is in the forum
Now your solution vc9 should be ok . BUT THE .EXE WILL BE BUILD IN "\trunk\vega-vc9\Release" or "\trunk\vega-vc9\Debug" by default .
( you won't be able to run or debug the game , step into etc ... )
So now , go to your project options , in " Linker" , change the output path like this : " D:\program\trunk\win32\bin\$(ProjectName).exe "
( change D:\program\trunk\ by your path :wink: )
Almost ended .
You need to copy the content of your folder "data" in your folder win32\bin DON'T FORGET TO UNZIP THE PYTHON 2.7 rar in \win32\bin !
GOOD ! Enjoy your new Vegastrike programming environment !
Visual C++ 8.0 (2005 Express)(deprecated)
This is left here in case someone wants to attempt a working VC8 build Warning: VC8 requires a big download off Microsoft's site.
Microsoft claims that they will continue offering their non-expiring version of VC8 forever, so I guess this will be the main build platform.
Keep in mind that VC8 does something weird with .manifest files, and for official builds, I would suggest VC7 as it seems to be faster, and it lacks compatibility issues. There are too many forum threads on this to count.
This will work on Windows 2000 or XP (Not sure about 98,95...).
- You have two download choices:
- Download the standard install: http://msdn.microsoft.com/vstudio/express/visualc/download/ and register (free but requires an E-mail and filling in a form)
- Download the "manual install" (from a CD image): http://msdn.microsoft.com/vstudio/express/support/install/ (seems to be an ISO image, but looks like it doesn't require registration...)
- Install the Windows Platform SDK (Instructions - FULL ISO version(395MB)). A more recent SDK for Windows XP SP2 exists, but it has not been tested with VS (yet.)
- In Visual C++ 8.0 (2005 Express), under Tools...Options...Visual C++ Directories, add an Include directory for C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include and an Include directory for C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc. If you forget this step, the build will not be able to find windows.h, basetsd.h, and afxres.h and will throw fatal errors.
- You should not need the DirectX SDK (337MB) to compile VS, but it may be required to compile OGRE in the future.
- Disable Intellisense: Microsoft provides no GUI for this, but it is recommended unless you want to eat up twice the RAM and wait 10-20 seconds between saving each file.
- Browse to your VC8 install.
- Go to the VC/vcpackages folders and rename the "feacp" DLL file to anything else like "feacp_backup.dll". This should not break anything... it will only disable IntelliSense.
- Checkout the Vegastrike project as described earlier.
- Open the "vega-vc8" project using the IDE.
- The compilation should go for the most part smoothly. If you encounter any problems, please tell us in the forum or specifically on this thread.
- Note that Debug versions will be very slow (I get 5 frames/second on my Pentium3 1GHz machine using debug VS).
Visual C++ 8.0(2005 Express) plus the Code::Blocks IDE (deprecated)
You can download Visual C++ 8.0(2005 Express) after you acquired a vcsetup.exe for Visual C++ 8.0. These are still being offered on some download sites. The main advantages of Visual C++ 8.0 over later versions are that it works for older OSes like Windows 2000 and that there is a vegastrike project file for it, which you can check out from svn as vega-vc8. You will also need an SDK, I used the Platform SDK PSDK-x86.exe (1.3 MB) which you can find with the query “Windows Server 2003 Platform SDK Web” in a search engine. You will need to enable internet explorer for a minute as the default browser to install the PSDK. Also try to get the vcredist_x86.exe for Visual C++ 8.0(2005 Express) if you want to share your vegastrike binary with others. You can acquire the code::block development environment from www.codeblocks.org.
You might want to make a copy of your SVN checkout tree now, to have a clean copy just in case of the code in VegaStrike/ and the project files in vega-vc8/
Start code::blocks, choose VC2005/2008 as default tool chain and import the .sln solution file from vega-vc8 into a workspace. Use the vc8 2005/2008 compiler.
Double click the vegastrike project so that it is selected in bold. Go to Project/Build options and add /EHsc to vegastrike in other compiler options, remove /W from all projects and choose a warning level you like instead for each compiling option, like /W1 for release and /W3 for a debug build.
I have only tried the Win32 and Win32 debug buildsYou will notice that the debug build sets other libraries in linker settings. Basically the left side of the settings is used to include libraries while the right side is used to NOT include the default libraries. Some people have reported that they need to add "/NODEFAULTLIB:libcmt" manually there to exclude libcmt from being linked which results in a conflict.(I also removed /ZI and added insted on the left side /Zi /D_DEBUG to have debug symbols, I'm not sure which is better).
You need to edit the file Resources.rc to read
#include <WinResrc.h>
instead of
#include "afxres.h"
If you should discover a problem with the PNG or Python libraries, or simply want to try out newer ones, recall that each of these libraries/dlls needs to be one built with the same compiler you use for vegastrike.
Be warned that for libpng-1.2.34 the optimized build does not work, while the debug build(without any optimization) works with the vc8 compiler.
You can also choose where the binaries you produced end up, but I left it to default settings which is in the ../win32/bin directory, thats right aside ../VegaStrike.
Finally I took the executable, which is named vegastrikeR.exe for the release version, and all other files produced and placed them into the directory structure of an old VegaStrike install.
Running vegaStrike produced errors, which meant I had to resolve them by checking out the directories bases,mission,programs,sounds/missions,techniques and textures directories from SVN using the repository browser. (I think you can even do without some of these.)
Copying the directories into and over the directory tree of the old install produced a working binary.
At least it works as far as I know - I didn't get to test much yet.
You can debug programs in the VC++ IDE by creating a new project and adding an executable as a subproject.
Enjoy!
Visual Studio 7.x (deprecated)
Compiling from the command line with Visual Studio
Here is a batch file that could be used to checkout everything and then compile all projects (copy and paste in makeall.bat
), if you were going somewhere for a few hours and wanted to get a working project when you got back:
@echo off mkdir vegastrike cd vegastrike svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/vega-vc7 svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/vegastrike svn co https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk/ cd vega-vc7 echo Building project... "C:\VC7\Common7\IDE\devenv.exe" vegastrike.sln /BUILD Debug cd .. cd ..
NOTE: You must replace the "C:\vc7
" with the directory where you installed visual c++ 7 and replace the "Debug
" on the same line with "Release
" if you want a release build.
Compiling with the Visual Studio GUI (deprecated)
(This is written with Visual C++ .NET Standard in mind)
Once you have checked out the vegastrike and vega-vc7 modules from CVS, use Visual Studio to open vegastrike.sln, found in the vega-vc7 directory. When compiling for release, select "Release Boost 131" from the drop-down menu on the toolbar. Right-click on the "vegastrike" project in the "solution explorer" sidebar, and then select "Build".
Visual C++ Toolkit 2003
This is a free download from Microsoft, and is the same compiler and linker as Visual Studio 2003.
Note, you must have Windows XP or 2000 in order to install the toolkit. (formerly said only Windows XP, but this is not true according to their download page)
Downloads
- Install the Visual C++ Toolkit 2003 from the Microsoft web site.
- Install the Windows Platform SDK from the Microsoft web site. You can take any of the 3 versions available.
- Install the Code::Blocks (alternative download site on Sourceforge). You can take the full version or the core only, since we will use the VS 2003 TK.
Configuring Code::Blocks
- Run CodeBlocks. The first time you install it, you will be listed with a set of compilers. Select Microsoft Visual C++ Toolkit, and click Set As Default.
- For configuration you have to include the location of the Windows Platform SDK. Go to Settings -> Compiler in the menu. Click the Directories tab. Add the directory "
C:\Program Files\Microsoft SDK\bin
" to the Resource Compiler tab.
Compiling with Code::Blocks and Visual C++ Toolkit
Once you have checked out the vegastrike and vega-vc7 modules from CVS, import the vegastrike.sln file, found in the vega-vc7 directory into Code::Blocks using Project->Import->MS Visual Studio Solution in the menu.
Note (CVS version as of 14 Nov 2005
Using the most recent CVS versions (and 2003/Runtime versions from Microsoft) I had to remove /W from the build options Project Build Options > Compiler Options > Other Options
Visual C++ 6.0 (deprecated)
As of the end of December, 2005, VegaStrike has dropped compatibility for VC 6 because of the new OGRE rendering engine.
VC 6 users can grab a free copy of VC 8 (Visual Studio 2005 Express) off the Microsoft site, and follow the directions below to compile.
Compiling using VC 6
Until the OGRE port is finished, VC 6 will still compile, so you can try it if VC8 won't work for you.
First, check out all the modules above.
Then from the MSDEV IDE, open the "vegastrike.dsw" project inside vega-proj, and compile. You will want to use Debug or Release configurations for a standard build. (The Boost 129 builds are permanently broken, and GLUT doesn't work very well as far as I know)
See Also
Checkout SVN | HowTos | Cygwin Compiling |