Home » MODDING HQ 1.13 » v1.13 General Development Talk » Quick Guide for Compiling and Debugging Source Code in Visual Studio
Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #301086] Tue, 06 March 2012 06:16 Go to next message
haydent

 
Messages:265
Registered:November 2007
Location: NSW, Australia
Install Visual Studio 2005, 2008, 2010 or 2013 (this guide is based on 2008)

Install JA2 Original

Checkout 1.13 from SVN:
https://ja2svn.mooo.com/source/ja2_v1.13_data/GameDir/
(and put it the files in your game dir)

Checkout SVN copy of source from repository with Tortoise SVN e.g.

Latest 1.13 Trunk:
https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13

Latest 1.13 MP Dev Branch:
https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2 1.13 MP
(there are gamedir files in this branch too, that need putting in the right place)


Open Corresponding .sln solution file for you VS version ie ja2_VS2008.sln

Once Open Click Menu At Top: Project -> Properties (Alt + F7)

Change "Configuration" dropdown to "All Configurations"

Click "Configuration Properties" -> General

Change "Output Directory" to you game directory (where ja2.exe is)

Click "Configuration Properties" -> Debugging

Change "Working Directory" to you game directory (where ja2.exe is)

Click OK, Save.

To Choose if you build a debug or release exe use the dropdown in top menu near green play button.

Use the build menu to just build, use green play button to build with debugging.

Compiled Exe's will appear in your game directory.

Maybe this can be stickied, and added to if need be.

[Updated on: Wed, 02 July 2014 23:02] by Moderator



Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #358687 is a reply to message #301086] Fri, 20 December 2019 06:09 Go to previous messageGo to next message
Kitty

 
Messages:230
Registered:October 2017
Location: Germany
Is this up-to-date enough in 2019?

And which version of Visual Studio is used nowadays?

The version I use to look into files is VisualStudioCode,
nut there is no "Projects"-tab in this one.



I need more details. (Didi Hallervorden)

Latest JA2 v1.13 (SCI-maeyanie) Compiling Guide 7609 (eng) MapEditor+UB 8908
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #358691 is a reply to message #358687] Fri, 20 December 2019 12:24 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3731
Registered:July 2009
Visual Studio Code is an entirely different product to Visual Studio 20XY. There's project files for up to VS2017, I don't know if there's any changes in VS2019 that would prevent a straight import of the '17 files, just give it a try.



Chat with us!
#bearpit on IRC
Discord
Get your latest 1.13 Builds
(Pls don't use my forum PMs for general game queries)


Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #358705 is a reply to message #358691] Sun, 22 December 2019 05:53 Go to previous messageGo to next message
Kitty

 
Messages:230
Registered:October 2017
Location: Germany
Thanks,

from first glance after downloading VisualStudioExpress2017 and VisualStudioCommunity, I probably
need more tutorials and research on them. First try ended with complains about missing extensions (SDK),
so I first need to learn more.
But it's good to know that it might be possible, if I learn to manage the tools. Don't know, if I can
realy make it happen, but I'll give it a try.



I need more details. (Didi Hallervorden)

Latest JA2 v1.13 (SCI-maeyanie) Compiling Guide 7609 (eng) MapEditor+UB 8908
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #360403 is a reply to message #358705] Thu, 18 June 2020 10:27 Go to previous messageGo to next message
Kitty

 
Messages:230
Registered:October 2017
Location: Germany
ok, finally managed to compile.

For building an MapEditor I used the same 113-source from SVN as for game-exe. Instead of "release", I've choosen "MapEditor" (VS2019). In quick tests this seems to be working, but is this the right way to do this? Or am I missing something?

And how am I building an UB-exe? Is there a different source for UB somewhere?



I need more details. (Didi Hallervorden)

Latest JA2 v1.13 (SCI-maeyanie) Compiling Guide 7609 (eng) MapEditor+UB 8908
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #360404 is a reply to message #360403] Thu, 18 June 2020 11:41 Go to previous messageGo to next message
Asdow

 
Messages:38
Registered:August 2010
Yeah, that should be correct for the mapeditor. For UB, pick release and then in builddefines.h you need to uncomment two lines.
// -----------------------------
// *****************************
// WANNE: Enable those 2 defines, if you want to build UB-Version!!

//JA2/Unfinished Business
#define JA2UB

//Unfinished Business - Titles (ja2set.dat)
#define JA2UBMAPS

Also, note that even though it should now launch a new game without issues after my fixes, since UB side hasn't been worked on in a long while it will have weirdness happening in game.

[Updated on: Thu, 18 June 2020 11:51]

Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361479 is a reply to message #301086] Mon, 05 October 2020 10:06 Go to previous messageGo to next message
Kitty

 
Messages:230
Registered:October 2017
Location: Germany
As supplement for Haydents allready good Guide for Compiling, I added some pictures (based on Visual Studio 2019).

Also with description on how to compile a MapEditor and UB.


Right-click on picture and display graphic to enlarge them.


haydent wrote on Tue, 06 March 2012 06:16
Open Corresponding .sln solution file for you VS version ie ja2_VS2008.sln
01

The following examples are based on Visual Studio 2019. The solution-file (in download from SVN Source) should look something like this:




Quote:
Once Open Click Menu At Top: Project -> Properties
02-03 additional explaination on steps before 04



04

open drop-down at Tab Project, there click at Properties

https://s2.imagebanana.com/file/201005/FqNh1wTU.png

05

Quote:
Change "Configuration" dropdown to "All Configurations"

Click "Configuration Properties" -> General
https://s1.imagebanana.com/file/201005/bVBQknu8.png

06

Quote:
Change "Output Directory" to you game directory (where ja2.exe is)
It doesn't have to be the game directory, you can define any directory as an output-directory.
At least, that's what I'm doing. So far the compiles have been working.
I can't see, why the former exe or the GameDir would be nescessary to compile the code.
Correct me if I'm wrong, so that I could adjust this description, if so.


https://s2.imagebanana.com/file/201005/ImDtAOj1.png


07

During the compiling, some intermediate files are created. Those need an output-directory as well.




08

Do check, if configuration type is .exe




09

Quote:
Click OK, Save.
Confirm changes, click ok to close.

https://s2.imagebanana.com/file/201005/DaBUCc09.png

10

Quote:
To Choose if you build a debug or release exe use the dropdown in top menu near green play button.

Use the build menu to just build, use green play button to build with debugging.
In that drop-down (of quote, not picture) you can also choose the MapEditor later on.

For anything else then debug, to build choose Tab "Build" at top and in drop-down (picture) of this then choose "Build ja2".

https://s1.imagebanana.com/file/201005/1xqovugq.png

[Updated on: Mon, 05 October 2020 20:50]




I need more details. (Didi Hallervorden)

Latest JA2 v1.13 (SCI-maeyanie) Compiling Guide 7609 (eng) MapEditor+UB 8908
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361480 is a reply to message #361479] Mon, 05 October 2020 10:06 Go to previous messageGo to next message
Kitty

 
Messages:230
Registered:October 2017
Location: Germany
11

Quote:
Compiled Exe's will appear in your game directory.
If the compiling is successful, it will look like this. The exe will appear in output-directory of your choice.

https://s1.imagebanana.com/file/201005/wMfb4rZU.png



12 - Compiling a MapEditor






19 Debugging

The compiled exe should allways be used with the matching GameDir. If updated from SVN at same time, it can be assumed that they match.

If you find any mistakes, please let me know, I will then adjust the descriptions and/or pics.

[Updated on: Mon, 05 October 2020 10:08]




I need more details. (Didi Hallervorden)

Latest JA2 v1.13 (SCI-maeyanie) Compiling Guide 7609 (eng) MapEditor+UB 8908
Re: Quick Guide for Compiling and Debugging Source Code in Visual Studio[message #361483 is a reply to message #361480] Mon, 05 October 2020 18:58 Go to previous message
Kitty

 
Messages:230
Registered:October 2017
Location: Germany
Haydents Guide is starting with instructions to checkout latest Source and gameDir from SVN, and is also providing the links to JA2-SVN for this.

He is suggesting to use a programm called TortoiseSVN for this. It's freeware and opensource and will allow a convenient way to download the files at the links.

It will add new entries to the context menu (that is, if you right-click on a file or folder). The same as, e.g. VLC-Player or 7-zip do.

More information and download here: TortoiseSVN

Following, I assume it's downloaded and installed.


If you wanna use it for JA2-SVN, start with creating a new and empty folder, name it however you like.

Right-click on this Folder to open the context menu. With TortoiseSVN, there will be an entry "SVN Checkout".

Click on this and a window will open. There is a field for "URL of Repository".
The links from starting post will go there. Haydent called the one for Source "Latest 1.13 Trunk" and
the one for GameDir "Checkout 1.13 from SVN". I don't know about the one about MP-branch, never used it.

Once the link is pasted in there and the path to SVN-Folder at your side is confirmed, click ok.
This will open another window and the download (checkout) will start.

For the source this probably won't take long, but the GameDir will take a few minutes.
If this initial checkout is finished, once again do a right-click on the folder you directed SVN to.

You'll see that the entries at context menu have changed. Instead of "SVN Checkout", there are now
SVN Commit and SVN Update. Commit is for developers with permission to add stuff.

If clicking on SVN Update, it will check for any changes and open a window with the results.
If the checkout just happened, there probably won't be any updates. Check the log for more details.

Repeat the above for both, the GameDir and the Source. Each with it's own folder and matching link.

Compile exe from SVN Source and use it with matching SVN GameDir (on top of JA2 vanilla, original), enjoy the latest JA2 v1.13.


That's it. Download, install, create folder, connect link, checkout, ready to update anytime.



For a more visual way of explaination, take a look at the picture.




More details on SVN:

Instructions for using SVN (by Marlboro Man)


An alternative to "Depri's v1.13 Builds Repository" for getting the latest, allready compiled, ready to use SCI

Mae's Builds

[Updated on: Thu, 08 October 2020 01:28]




I need more details. (Didi Hallervorden)

Latest JA2 v1.13 (SCI-maeyanie) Compiling Guide 7609 (eng) MapEditor+UB 8908
Previous Topic: Instructions for using SVN
Next Topic: SVN Server Support
Goto Forum:
  


Current Time: Sat Oct 24 23:12:08 EEST 2020

Total time taken to generate the page: 0.01002 seconds