Editing Free Compiler Setup Under Linux

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 article explains how to setup a free compiler, MS VC++, under Linux through Wine, under assumption, that [[Orbiter]] itself can be [http://www.orbiterwiki.org/wiki/Running_Orbiter_under_Wine ran under Linux through Wine] for testing your modules. Latest possible setup that is capable of doing it is [http://www.winehq.org Wine 1.6.2] and [http://orbit.medphys.ucl.ac.uk/download.html Orbiter 2016], using the built-in DX7 graphical client and [http://orbiter-forum.com/showthread.php?t=18431 DX9 client]. The steps presented here have been tested on Debian-stable ("jessie").  
+
This article explains how to setup a free compiler under Linux, under assumption, that Orbiter itself can be ran under Linux with Wine for testing your modules. Latest possible setup that is capable of doing it is [http://www.winehq.org Wine 1.6.2] and [http://www.orbiter-forum.com/download.php ORBITER 2010-P1], using the built-in DX7 graphical client and [http://orbiter-forum.com/showthread.php?t=18431 DX9 client]. The steps presented here have been tested on Debian-stable ("jessie").  
The concept is based on downloading and running MS VC++ executables, wrapped by [http://www.winehq.org Wine], and fed back to a native multiplatform IDE - [http://www.codeblocks.org/ Code::Blocks]. Thanks to [https://wiki.winehq.org/Winetricks winetricks], it's of course easy to download the VC++ executables, along with its IDE, and run the whole VC's IDE through Wine, but such a setup is unstable.  
+
The concept is based on downloading and running MS VC executables, wrapped by [http://www.winehq.org Wine], and fed back to a native multiplatform IDE - [http://www.codeblocks.org/ Code::Blocks]. Thanks to [https://wiki.winehq.org/Winetricks winetricks], it's of course easy to download the VC executables, along with its IDE, and run the whole IDE through Wine, but such a setup is unstable.
 +
Naturally, after succesful compilation of your module, you'll want to test it on Linux as well. Refer to [http://www.orbiterwiki.org/wiki/Running_Orbiter_under_Wine this article] to learn how to run Orbiter under Wine.
  
 
== Preparing Code::Blocks ==
 
== Preparing Code::Blocks ==
Line 58: Line 59:
 
</pre>
 
</pre>
  
== Preparing MS VC2005 Express and Platform SDK ==
+
== Preparing MS VC2005 Express ==
Execute the following script and take note of the comments at winetricks installation:
+
=== IDE ===
 +
Download the IDE and executables
 
<pre>
 
<pre>
#!/bin/bash
+
winetricks vc2005express
 +
</pre>
 +
Select installation of only the first option (the IDE)
  
 +
=== Platform SDK ===
 +
Download and install PSDK, which most importantly, contains the crucial Windows.h header.
 +
The following script comes from [http://appdb.winehq.org/objectManager.php?sClass=version&iId=9569 WineDB]
 +
<pre>
 
prefixName=vc2005express
 
prefixName=vc2005express
prefixDir=$HOME/.local/share/wineprefixes
+
prefixDir=$HOME/.local/share/wineprefixes/
prefix=$prefixDir/$prefixName
 
  
export WINEPREFIX=$prefix
+
for ((i=1; i<=10; i++)) ; do wget http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.$i.cab ; done
export WINEARCH=win32
+
wget http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.bat
 +
wget http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/Extract.exe
 +
WINEPREFIX=$prefixDir/$prefixName wine start.exe PSDK-FULL.bat "C:\psdktemp"
 +
</pre>
 +
Wait until the previous command finishes before executing the next one:
 +
<pre>
 +
WINEPREFIX=$prefixDir/$prefixName wine "C:\psdktemp\Setup.Exe"
 +
</pre>
 +
Install only the "Configuration Options" and "Microsoft Windows Core SDK". Be sure to check if the PSDK got installed under $HOME/.local/share/wineprefixes/vc2005express/Program Files. If not, (could be $HOME/.local/share/wineprefixes/vc2005express/INSTALLLOCATION), move it straight to $HOME/.local/share/wineprefixes/vc2005express/psdk
  
winetricks vc2005express # Deselect every component at installation
+
=== Symbolic links for ease ===
winetricks psdk2003 # Choose typical installation
+
<pre>
 +
cd $prefixDir/$prefixName/drive_c
 +
mkdir vc && cd vc
 +
ln -s ../Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/bin/
 +
ln -s ../Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/include/
 +
ln -s ../Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/lib/
  
# Link the installed VC and SDK
+
# Ommit this step, if the PSDK was already moved to the psdk dir
cd $prefix/drive_c
+
cd $prefixDir/$prefixName/drive_c
ln -s Program\ Files/Microsoft\ Visual\ Studio\ 8/VC
+
mkdir psdk && cd psdk
ln -s ../../psdk2003/drive_c/Program\ Files/Microsoft\ Platform\ SDK psdk # Symlink to psdk from other prefix
+
ln -s ../Program\ Files/Microsoft\ Platform\ SDK\ for\ Windows\ XP\ SP2/Include
 +
ln -s ../Program\ Files/Microsoft\ Platform\ SDK\ for\ Windows\ XP\ SP2/Lib
  
# Link an important dll, without which the toolchain fails
+
# Link the installation links to main .wine dir
cd $prefix/drive_c/windows/system32
+
cd $HOME/.wine/drive_c
ln -s ../../Program\ Files/Microsoft\ Visual\ Studio\ 8/Common7/IDE/mspdb80.dll
+
ln -s $prefixDir/$prefixName/drive_c/vc
 +
ln -s $prefixDir/$prefixName/drive_c/psdk
 
</pre>
 
</pre>
  
 
== VC++ Wine wrappers ==
 
== VC++ Wine wrappers ==
Execute the following command to have a common (exchangeable) WINEPREFIX for the tool chain:
+
For some reason the WINEPREFIX didn't work on my box, therefore I needed to use the global .wine installation.  
<pre>
 
echo "$HOME/.local/share/wineprefixes/vc2005express" > $HOME/devel/bin/wineprefix-vc.txt
 
</pre>
 
 
Create the following files:
 
Create the following files:
 
<pre>
 
<pre>
Line 94: Line 113:
 
<pre>
 
<pre>
 
#!/bin/bash  
 
#!/bin/bash  
 
+
wine $HOME/.wine/drive_c/vc/bin/cl.exe /I"c:/vc/include" /I"c:/psdk/Include" $@  
export WINEPREFIX=`cat $HOME/devel/bin/wineprefix-vc.txt`
 
wine c:/VC/bin/cl.exe /I"c:/VC/include" /I"c:/psdk/Include" "$@"
 
 
</pre>
 
</pre>
 
<pre>
 
<pre>
Line 103: Line 120:
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
 
+
wine $HOME/.wine/drive_c/vc/bin/link.exe /LIBPATH:"c:/vc/lib" /LIBPATH:"c:/psdk/Lib" $@
export WINEPREFIX=`cat $HOME/devel/bin/wineprefix-vc.txt`
 
wine c:/VC/bin/link.exe /LIBPATH:"c:/VC/lib" /LIBPATH:"c:/psdk/Lib" "$@"
 
 
</pre>
 
</pre>
 
<pre>
 
<pre>
Line 112: Line 127:
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
 
+
wine $HOME/.wine/drive_c/vc/bin/rc.exe /I"c:/vc/include" /I"c:/psdk/Include" $@
export WINEPREFIX=`cat $HOME/devel/bin/wineprefix-vc.txt`
 
wine c:/VC/bin/rc.exe /I"c:/VC/include" /I"c:/psdk/Include" "$@"
 
 
</pre>
 
</pre>
  
Line 132: Line 145:
 
* Download, open and use [https://sf.net/p/enjomitchsorbit/codeHG Launch MFD] project file (available under launchmfd/LaunchMFD.cbp) as a template
 
* Download, open and use [https://sf.net/p/enjomitchsorbit/codeHG Launch MFD] project file (available under launchmfd/LaunchMFD.cbp) as a template
 
* Download and use in your project the header file launchmfd/afxres.h. This is required for VS Express.
 
* Download and use in your project the header file launchmfd/afxres.h. This is required for VS Express.
* Change orbiter2016/Orbitersdk/include/Lua to lua
 
 
* Add some sources and hit The Compile Button(TM) !
 
* Add some sources and hit The Compile Button(TM) !
  
[[Category: Articles]]
+
[[Category:Tutorials]][[Category:Addon tutorials]]
[[Category:Tutorials]]
 
[[Category:Add-on tutorials]]
 

Please note that all contributions to OrbiterWiki are considered to be released under the GNU Free Documentation License 1.2 (see OrbiterWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)