OpenXcom Forum

Contributions => Programming => Topic started by: Istrebitel on June 25, 2014, 09:40:41 pm

Title: I'm terrible at this, please help me compile OpenXCom
Post by: Istrebitel on June 25, 2014, 09:40:41 pm
Well, title says it all. I'm a C# programmer (done a lot of C/C++ stuff in the past) and I consider myself quite advanced with PCs, but I just don't get this.

So, I want to compile OpenXCom for myself since I want to add some debug output to debug air combat (https://openxcom.org/bugs/openxcom/issues/717). I downloaded the code from git. I have VS2010 installed, so I open the sln file. I compile and it fails - needs yaml's header. Okay, I'm looking at the readme and it says I need five libs:

- SDL (libsdl1.2):
https://www.libsdl.org
- SDL_mixer (libsdl-mixer1.2):
https://www.libsdl.org/projects/SDL_mixer/
- SDL_gfx (libsdl-gfx1.2), version 2.0.22 or later:
https://www.ferzkopp.net/joomla/content/view/19/14/
- SDL_image (libsdl-image1.2):
https://www.libsdl.org/projects/SDL_image/
- yaml-cpp, version 0.5.1 or later:
https://code.google.com/p/yaml-cpp/


Okay, I start with yaml-cpp. I download it - it's a folder with folders inside. Where do I put them? How do I tell VS2010 where to look for them? Okay, I guess I go into project properties and add an include path to the folder that contains the folder that contains yaml's header. But now it complains about some "boost/shared_ptr.hpp"... what is an hpp anyway? I only remember there being "h" files and "cpp" or "c" files! Anyway, I look at the yaml's google code page and readme and it doesn't tell me I need any other library to use yaml... I google and it seems I do need this "boost" so I download it... another folder, with another bunch of folders... do I add it again to the "include" paths? But then I'm looking at SDL site, and no download option offers "libsdl1.2"... or does it mean I need to get source codes?....

You see, I'm kinda getting nowhere here... and I don't even know where to read about this. It seems it's so trivial to other people since nowhere it explains how to do it! And I don't even know how to google for this, because... well, I don't know what to ask for!

Can anyone who has already done this please tell me how am I supposed to do it properly?

Thanks in advance!
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: AndO3131 on June 25, 2014, 10:20:03 pm
Maybe try pre-compiled dependancies (https://openxcom.org/download/dev/openxcom-deps-win-vc.zip)?

Edit: I've read it https://www.ufopaedia.org/index.php?title=Compiling_with_Microsoft_Visual_C%2B%2B_%28OpenXcom%29 (https://www.ufopaedia.org/index.php?title=Compiling_with_Microsoft_Visual_C%2B%2B_%28OpenXcom%29)
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: Yankes on June 25, 2014, 10:28:19 pm
hpp is C++ header, it could be hxx too if you use different compiler (this is why std dont have extension at all).
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: Istrebitel on June 25, 2014, 10:47:48 pm
Many thanks for the link, AndO3131!

However, was I supposed to guess that (I mean, for example, that dependencies go in the "deps" folder)? I mean, there is no such folder initially, and readme does not say that you have to put dependencies in that folder...
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: Istrebitel on June 26, 2014, 12:53:04 am
RRrright, got it to compile, and found a really big bug (basically, missile weapons almost can't miss because if they miss, they try to hit again and again several times in a row before finally giving up)
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: KingMob4313 on June 26, 2014, 04:02:49 am
Wow, timely thread.

Thanks for the help everyone. I just gotta clear an issue with 'Error   247   error RC1015: cannot open include file 'afxres.h'.' and I'll be compiling. I just need to get the foundation classes.
'
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: Warboy1982 on June 26, 2014, 04:09:53 am
https://openxcom.org/forum/index.php?topic=1357.msg12353#msg12353 (https://openxcom.org/forum/index.php?topic=1357.msg12353#msg12353)
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: KingMob4313 on June 26, 2014, 04:57:21 am
Warboy1982, you are a ninja.

Thank you.
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: SupSuper on June 29, 2014, 12:55:50 am
If you're compiling the dependencies yourself, you gotta build Debug and Release versions of yaml-cpp separately (named "yaml-cppd.lib" and "yaml-cpp.lib" respectively).
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: FudgeDragon on June 30, 2014, 11:13:36 am
Following on from what SupSuper says, It also probably bears mentioning that depending on which version of yaml-cpp you've download you may need to change the names of the dependencies (in Properties->Configuration Properties->Linker->Input->Additional Dependencies) for your release and debug configurations.

In the new version of yaml-cpp the libraries are called libyaml-cppmd.lib (for release) and libyaml-cppmdd.lib (for debug)
Title: Re: I'm terrible at this, please help me compile OpenXCom
Post by: KingMob4313 on July 06, 2014, 05:14:32 am
If you're compiling the dependencies yourself, you gotta build Debug and Release versions of yaml-cpp separately (named "yaml-cppd.lib" and "yaml-cpp.lib" respectively).

Thanks for the big help today. I have a release now built on my machine and I'm arms deep in mechanics now.