Previous page Select page Next page

Compiling the code

We’re now ready to build the project. At the right hand end of the main toolbar, you will see a couple of groups, as shown here. The first button allows you to compile the currently selected window – “winMain”, in this case. The second, is to compile the project. The third one (“Rebuild all”) does everything – compile, link, the whole shooting match. That’s the one we want, so click it now. Since we have done absolutely no coding, you should have no problems. If you do, it’s most likely because EasyCode cannot find the compiler or other components that it needs. Check that you completed the settings properly. But if everything went well, you should see the following message in the debug window.

You can now run your program by selecting the fourth button in the group above – the one that looks like an exclamation mark. Your first program should appear. Yes, it’s just a little window with the caption bar reading “Hello, World!” but it works. Congratulations.

Your new program is a true executable. You can give it proudly to friends and they can run it on their computer. The problem is that we don’t know how we did it. This is the time to look at the assembly code generated for us by EasyCode, and we’ll do that in a moment or two. But before we move on, you might want to play around with your window. Just for fun. For example, go to the properties window and select the “BackColor” property. It will display an ellipsis button (one with three dots). Click this button and the current style palette will appear. If you don’t want one of the attractive shades of grey, you can select the “Palette” button at the bottom of that dialog. This will bring up the Windows colour chooser. Select a colour of your choice and the main colour of the window will change accordingly. Play around like this with some of the other attributes of the window, remembering to rebuild your project each time before selecting the “Run” button. This is how you become familiar with the EasyCode interface – play with it.

OK, settle back down again. Look back at what the Debug window said – “helloWorld - Debug” and a file size of around 59,000 bytes. Using Windows Explorer take a look at the directory where you saved the project. You should see 3 folders that you never created. These are the Debug, Release and Res sub-directories. It’s in the first of these that you will find your program and supporting code. The reason EasyCode put it there lies in the settings you accepted in your project properties dialog – the “Symbolic information” checkbox. What this means is that EasyCode arranges with goAsm for extra information to be added into your program to assist any debugger you might be using. Once you have gone through a number of iterations of coding, compiling, running and identifying bugs you would be confident that your application was fit to be released to the world at large. You wouldn’t need the symbolic information any longer and you would be expected not to include it any more. So, how do we remove it? Bring up the project properties dialog, uncheck the symbolic information option and then rebuild the project. Simple. Now you will see a message like this-

You can now see that this is a “Release” version of the program, not one which is capable of being debugged. The files are now in the “Release” folder. But the big thing is the file size – just over 20,000 bytes. Nearly a third of the previous version! Why is this? Two things, really. Firstly, there is no debugging information cluttering up the code (around 10,000 bytes worth) and, secondly, EasyCode uses a public domain file packer for executable files – UPX. You saw the checkbox for it in the project properties dialog. This can reduce the size of your exes while still allowing them to run in that state. So your “helloWorld.exe” is now compressed, too. Brilliant.

Previous page Select page Next page