Jegas Edit - Compiler Configuration
Jegas Edit - Compiler Configuration
Who is this article for?
This article is for folks wishing to use FreePascal, UnrealScript or Microsoft's Visual Studio 2008 or 2010 with C++ from within Jegas Edit or just wishing to get some pointers about compiling Microsoft's C++ from the command line.
Assumptions about the reader.. the Reader... :
- - Possesses Jegas Edit
- - Possesses Microsoft Visual Studio 2008 or 2010 or Unreal's Development Kit (UDK)
- - Has a rudimentary understanding of the command line
- - Understands the risk and implications of modifying system settings such as PATH and enviroment variables
- - Understands how to change these system environment variables and the system's path
Why did we write this article?
In short to help save folks some time... that's it really. But next I'll share how we got here....
A programmer I know desiring to dive into C++ basics chose to use JegasEdit to learn the command line and the core fundementals of C++ without all the bells and whistles.
"Well..", I said, "Dive in there and figure it out by searching for and trying things."
Determined as he was, our developer friend couldn't get Visual Studio 2010 Ultimate to compile anything; regardless of all the online help that says you can this way or that (we tried).
So I decided to jump in and quickly save the day. That didn't happen so you know - nothing was quick... I tried. I thought to myself, "How hard can it be? It's Microsoft? It's C++? It's in wide use? Compiling using the command line tools they provide should be a simple task...right? I should only have to search quickly on the internet, find an article about it and be off and running."
Two hours and many many articles later we managed to get both Visual Studio 2008 and Visual Studio 2010 working from the command line, and we able to then configure JegasEdit so it could in fact compile and run Microsoft C++ programs.
Prior to this event, I managed to get JegasEdit to work with UnrealScript and the Oct2011 release of their Unreal Development Kit (aka UDK)... and this took awhile too so we're going to share those settings as well.
Your system and file paths may (most likely will) vary!
It is difficult to cover all bases, all the time so we are going to provide what we did and we expect that on your end, there may be many differences. However true this may be, we think getting a clue from anything that works is better than having something that doesn't with nowhere to turn.
Microsoft Visual Studio C++ 2008(express) and 2010 (Ultimate)
Download those HUGE Windows SDKS? Maybe NOT!
I'm NOT saying you won't need to download gigabytes to get a Microsoft Windows SDK, but we didn't. The reason I didn't jump and start downloading when the "web" suggested this as a requirement is simple: You can download Microsoft Visual Studio Express C++ 2005, 2008 or 2010 and write a simple console application and compile it without additional downloads inside Visual Studio usually without too much fussing about with settings. So, if thier Visual Studio has the tools to do it, certainly we can do the same thing without firing up the FRONT END Visual Studio GUI tool. I was right, for both systems we did not need a Windows SDK. More complicated projects aside from our Hello World! program might require one SDK or another to work surely. (SDK = Software Development if you are wondering).
Before you Proceed...
Note that changes to your system path and evironment variables directly in this endeavor may make your system less able to go from one version of Visual Studio to another if you have multiple installations on your machine. Additionally, making a mistake while changing your system path or environment variables may render your machine, or certain software useless and effectively "broken".
Visual Studio C++ Settings
NOTE: We were using Visual Studio Express 2008 C++
vs2008 - SYSTEM PATH ADDITIONS - TWO OF THEM
- "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE";
- "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin";
vs2010 - SYSTEM PATH ADDITIONS - TWO OF THEM
- "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE";
- "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin";
ENVIRONMENT VARIABLE ADDITION - ONE, BUT TWO VALUES IN IT
You need to go into your system variables, under system or user - if you're not sure, work in the USER one. If its your PC and no one else uses it, it matters less in my opinion. Ok look to see if you have an environment variable listed named LIB, as we do not want to have duplicate environment variables. Having duplicate environment variable may work, but I'm not certain and I tend to think it might cause unneeded hassle having a duplicate. Presuming you find an EXISTING LIB environment variable, check it for the values below, otherwise add these two values below to it like you were adding a new path to the system PATH variable (user or system). NOTE: Values are separated by semicolons and ever since someone complicated matters by allowing spaces into directory and file names, you need to put double quotes around path and file names if there are spaces in them. EXAMPLE: "C:\Program Files\MyFolder"
Please add the following two entries to your Environment Variables Area. The Variable needs to be Called "LIB" and the values are below:
vs2008 - Environment Variable Addition LIB
- "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib";
- "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib";
vs2010 - Environment Variable Addition LIB
- "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib";
- "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib";
Finally, in JegasEdit, Select Tools->Options->Syntax and from there, on the bottom left of the window that should be in the center of your screen is a dropdown list named languages. Select C++ and you will see three three categories of settings appear in the area above this list. The middle one titles "External Commands" is where we are going to make a change; so open up that section by clicking the tiny white triangle that points to the right to expand it. There you will see a list of commands you can configure. Select the External Command titled "Compile" and a text box will appear on the right. Here you want to place the following:
vs2008 - JegasEdit C++ Compile Command
- cl %1 /I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include"
vs2010 - JegasEdit C++ Compile Command
- cl %1 /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
NOTE: The %1 in the commands above are replaced with the name of the file you are working on in JegasEdit. So to compiled from the command line, you can paste the above line into a console prompt and replace the %1 yourself with the name of the file you wish to compile and link yourself - and it should work.
Save your Jegas Edit Options
Click the Save Button on the JegasEdit Tools->Options window to Save your changes. Then click OK to close the options window.
Now hopefully you can compile Microsoft C++ 2008 or 2010 from the command line and from within JegasEdit. We're going into how to set up JegasEdit for compiling UnrealScript next.
UnrealScript
First we're going to go out on a limb and presume if you're diving into UnrealScript you have computer skills or are a determined game designer capable of filling in gaps by searching the internet for help with your internet browser.
Adding a new language to JegasEdit
In JegasEdit Tools->Options Select the Languages Tab. On the left are languages that are set up for JegasEdit, on the right there is a text box titled New Language Short Name. Type UDK in this area. Next, in the text box below it, type in UnrealScript then click the Add New Language button to commit your new language.
Next go to the File Extensions tab and enter uc into the top right text box and then click the Add New File Extension button.
Now for the BIG PASTE! Go to the Syntax tab and select UnrealScript. Now look at the bottom left of the window, there is a pull down list there. Select UnrealScript and three categories of options for this new language will appear above the list you just clicked. Click on the Syntax Properties's tiny white triangle to expand those options. Now click the Keywords option and then you will see an empty text area: we are going to paste in UnrealScript Keywords (the ones I know of anyway as of 2011-11-17). The keywords are listed below:
abstract always array arraycount assert auto automated bool break button byte case class coerce collapsecategories config const continue default defaultproperties delegate dependson deprecated do dontcollapsecategories edfindable editconst editconstarray editinline editinlinenew editinlinenotify editinlineuse else enum enumcount event exec expands export exportstructs extends false final float for foreach function global globalconfig goto guid hidecategories if ignores import init input insert instanced int intrinsic invariant iterator latent length local localized name native nativereplication new noexport none noteditinlinenew notplaceable nousercreate operator optional out perobjectconfig placeable pointer postoperator preoperator private protected reliable remove replication return rng rot safereplace self showcategories simulated singular skip state static stop string struct super switch transient travel true unreliable until var vect while within NONTRANSIENT Engine Editor Game NONEDITINLINENEW hidedropdown INHERITS IMPLEMENTS Server Client
UnrealScript - JegasEdit - Compiling and Launching
Ok... Our language is created in JegasEdit, we taught JegasEdit the keywords and the file extension for UnrealScript, next we need make sure at a minimum we can compile UnrealScript from inside Jegas Edit. It's easier than Microsoft Visual Studio believe it or not. Here is the command line I use in JegasEdit to compile and test a given tutorial found on UDK's website.
Assuming you are still Tools->Options Syntax Tab looking at the keywords option, click on the tiny triangle next to Syntax Properties to collapse it and then click on tiny triangle (or double click the words themselves) External Commands. You should now see the various external commands you can change and use in JegasEdit for UnrealScript. Each language in JegasEdit has it's own set of External commands in case you weren't aware. Ok... Click on the Compile command and in the text box on the right, paste in the following - HOWEVER you will have to modify this value to reflect your own UDK installation:
- c:\p\udk\binaries\win32\udk.com -make -useunpublished %1
Remember, the only difference from compiling USK from the command line and the value above is the %1 is where the UnrealScript filename you're compiling goes. JegasEdit replaces the %1 with the file's name you're editing.
Now click on the compile command. Note, this value I'm showing works but for one project. When you switch projects, you'll likely want to go in here and either CHANGE the project information OR set up user command 1 for one project, and user command 2 for another etc. There are five user commands there for this sort of thing if needed. In the Compile textbox, I currently the following value:
- c:\p\udk\binaries\win32\udk.com -make -useunpublished %1
Next, click on the Run command just below the Run command we were on. Here is the value I use for the UDK Tutorial CluOne.CluOneGame and using the ExampleMap:
- c:\p\udk\binaries\Win32\udk.exe ExampleMap?game=CluOne.CluOneGame
Save your Jegas Edit Options
Click the Save Button on the JegasEdit Tools->Options window to Save your changes. Then click OK to close the options window.


The 
