Editing Free Compiler Setup
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | This page documents the travails and heartache necessary to get the | + | This page documents the travails and heartache necessary to get the MSVC++ 2005 Express Edition to compile Orbiter projects. |
A video tutorial is also available [http://www.youtube.com/watch?v=VBRLkN__YIo HERE]. | A video tutorial is also available [http://www.youtube.com/watch?v=VBRLkN__YIo HERE]. | ||
Line 6: | Line 6: | ||
=== Get the Compiler === | === Get the Compiler === | ||
− | Go to the [ | + | Go to the [http://www.microsoft.com/express/2005/ Microsoft download center] and get the compiler. |
+ | Alternatively, download [http://msdn.microsoft.com/vstudio/express/support/install/ ISO image], which can be mounted, or burned to CD for off-line installing. | ||
+ | |||
+ | Alternatively you can get Visual Studio 2008 Express edition, though it is not yet fully tested to be compatible with Orbiter. That can be downloaded here: [http://www.microsoft.com/express/download/ MSDN Visual Studio Download Center] | ||
Tell the program you are agreeing to its pernicious license agreement, but do it with your fingers crossed. | Tell the program you are agreeing to its pernicious license agreement, but do it with your fingers crossed. | ||
Line 14: | Line 17: | ||
=== Get Orbiter and the SDK === | === Get Orbiter and the SDK === | ||
− | Get Orbiter from [ | + | Get Orbiter and the OrbiterSDK from [http://www.orbitersim.com/ Orbitersim.com] and unpack it. |
+ | |||
+ | For the latest version of Orbiter, 2006-P1, you need the following files: | ||
+ | |||
+ | #Orbiter Base (060929) | ||
+ | #Orbiter SDK (060929) | ||
− | For the | + | For the older Orbiter 06 version, you need the following files: |
− | + | #Orbiter Base (060504) | |
+ | #Orbiter SDK (060504) | ||
− | For the older Orbiter | + | For the older Orbiter 05 version, you need at least 4 files: |
− | #Orbiter Base ( | + | #Orbiter Base (050116) |
− | #Orbiter SDK ( | + | #Orbiter SDK (050116) |
+ | #Orbiter Base Patch (050216) | ||
+ | #Orbiter SDK Patch (050216) | ||
Unpack all these files into the same folder, in order. A good choice is <tt>C:\Orbiter</tt>. This document assumes you use this path, from now on. | Unpack all these files into the same folder, in order. A good choice is <tt>C:\Orbiter</tt>. This document assumes you use this path, from now on. | ||
Line 33: | Line 44: | ||
You need the SDK to get <tt>windows.h</tt> and its associated files. | You need the SDK to get <tt>windows.h</tt> and its associated files. | ||
− | The latest version of the SDK (Microsoft Windows SDK for Windows | + | The latest version of the SDK (Microsoft Windows Server 2003 R2 Platform SDK) is available as [http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en Web Installer], as [http://www.microsoft.com/downloads/details.aspx?FamilyId=484269E2-3B89-47E3-8EB7-1F2BE6D7123A&displaylang=en Full Download], and as [http://www.microsoft.com/downloads/details.aspx?familyid=E15438AC-60BE-41BD-AA14-7F1E0F19CA0D&displaylang=en ISO Image]. The download of this version requires Windows Genuine Advantage validation. |
+ | |||
+ | NOTE: A new version of the SDK, that does NOT requre validation ( Windows SDK for Windows Server 2008 and .NET Framework 3.5) is now available. The Web Installer is located [http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en here] | ||
+ | |||
+ | There is also an earlier version of the SDK (Windows Server 2003 SP1 Platform SDK) available, which does not require the validation, and is still perfectly adequate for our purpose: [http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en Web Installer], [http://www.microsoft.com/downloads/details.aspx?familyid=EBA0128F-A770-45F1-86F3-7AB010B398A3&displaylang=en Full Download], and [http://www.microsoft.com/downloads/details.aspx?familyid=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92&displaylang=en ISO Image]. | ||
Run the installer and uncheck everything but what is shown below. | Run the installer and uncheck everything but what is shown below. | ||
Line 63: | Line 78: | ||
[[Image:SDKInstall5.png]] | [[Image:SDKInstall5.png]] | ||
− | + | === C++ language change === | |
There are a few important changes between code for Visual C++ 2005 and earlier versions. Fortunately, only small modifications to the code are required to compensate for them. | There are a few important changes between code for Visual C++ 2005 and earlier versions. Fortunately, only small modifications to the code are required to compensate for them. | ||
Line 94: | Line 109: | ||
Note that to allow backwards compatibility it's best to always define a for() loop variable outside the loop in this manner, even when no code tries to access the variable outside the loop. Otherwise, if, for example, you include two for() loops in the same function which both define <tt>int i</tt> as their loop variable, it will compile in VC++2005 but fail to compile in older versions. | Note that to allow backwards compatibility it's best to always define a for() loop variable outside the loop in this manner, even when no code tries to access the variable outside the loop. Otherwise, if, for example, you include two for() loops in the same function which both define <tt>int i</tt> as their loop variable, it will compile in VC++2005 but fail to compile in older versions. | ||
− | There is an option in the project compiler settings window which changes this particular standard, but the code change makes the code clearer and more readable, and, more importantly, it's now correct C++ code according to the C++ standard. | + | There is an option in the project compiler settings window which changes this particular standard, but the code change makes the code clearer and more readable, and, more importantly, it's now correct C++ code according to the C++ standard. |
=== Adding and Removing libraries === | === Adding and Removing libraries === | ||
Line 108: | Line 123: | ||
== Compiling and adding resource files == | == Compiling and adding resource files == | ||
− | + | (Not required for the ShuttlePB example, ONLY REQUIRED FOR VC++ 2003 toolkit <, VC++ 2005 and VC++ 2008 express edition compilers can compile resources without problems) | |
VC++ 2003 toolkit doesn't support the compilation of resource files (.res) from source files (such as bitmaps .bmp). However, there is a command line resource compiler (rc.exe) which is installed when you install VC++ Express. The default location for this program is C:\Program Files\Microsoft Visual Studio 8\VC\Bin\rc.exe. | VC++ 2003 toolkit doesn't support the compilation of resource files (.res) from source files (such as bitmaps .bmp). However, there is a command line resource compiler (rc.exe) which is installed when you install VC++ Express. The default location for this program is C:\Program Files\Microsoft Visual Studio 8\VC\Bin\rc.exe. | ||
Line 157: | Line 172: | ||
Once the project has been saved VC++2005 will have created a number of new files in the original directory. To reopen the project at a later date you should open the .sln file, as opposed to the original .dsw file. If you open the project from the .sln file all of the changes you made in the previous section will be intact as opposed to going through the process of conversion again. | Once the project has been saved VC++2005 will have created a number of new files in the original directory. To reopen the project at a later date you should open the .sln file, as opposed to the original .dsw file. If you open the project from the .sln file all of the changes you made in the previous section will be intact as opposed to going through the process of conversion again. | ||
− | + | == Visual C++ 2010 Express == | |
− | The instructions in this [http://www.youtube.com/watch?v=VBRLkN__YIo video], mentioned above, were tested and verified also with Visual C++ Express 2010, and everything works fine. One note, VC++2010 hides the build button per default, so one needs to activate expert mode (read [http://www.daniweb.com/software-development/cpp/threads/290416/1249773#post1249773 here | + | The instructions in this [http://www.youtube.com/watch?v=VBRLkN__YIo video], mentioned above, were tested and verified also with Visual C++ Express 2010, and everything works fine. One note, VC++2010 hides the build button per default, so one needs to activate expert mode (read [http://www.daniweb.com/software-development/cpp/threads/290416/1249773#post1249773 here). |
== Errors and solutions == | == Errors and solutions == | ||
Line 166: | Line 181: | ||
'''Error:''' fatal error RC1015: cannot open include file 'afxres.h'. | '''Error:''' fatal error RC1015: cannot open include file 'afxres.h'. | ||
− | + | '''Solution:''' add the 'include\mfc\' folder of the Platform SDK (default <tt>C:\Program Files\Microsoft Platform SDK\include\mfc</tt>) to "Configuration Properties/Resources/Additional Include Directories" | |
− | |||
− | ''' | ||
− | |||
− | |||
=== error LNK2019: unresolved external symbol ... === | === error LNK2019: unresolved external symbol ... === | ||
Line 201: | Line 212: | ||
{{HasPrecis}} | {{HasPrecis}} | ||
− | |||
− | |||
− | |||
== External Links == | == External Links == | ||
*[http://www.youtube.com/watch?v=VBRLkN__YIo Comprehensive video tutorial on setting up a development environment] | *[http://www.youtube.com/watch?v=VBRLkN__YIo Comprehensive video tutorial on setting up a development environment] | ||
− | + | [[Category:Tutorials]][[Category:Addon tutorials]] | |
− | [[Category:Tutorials]][[Category: |