aliens

Author Topic: Compiling with Visual Studio 2010, and related  (Read 14402 times)

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
Compiling with Visual Studio 2010, and related
« on: October 13, 2012, 10:38:47 am »
I've not seen a topic like this, so i opened it.

The guide in the wiki regarding the compile process in VS2010 is pretty good.

But what i've not managed to find out, is:
How can i link the following files STATICALLY?
Code: [Select]
libFLAC-8.dll
libmikmod-2.dll
libogg-0.dll
libvorbis-0.dll
libvorbisfile-3.dll
SDL.dll
SDL_gfx.dll
SDL_mixer.dll
smpeg.dll
yaml-cpp.dll
yaml-cppd.dll

It is really annoying that the compiled EXE requires a bunch of DLL-s. :(

Of course i have looked in the linker options, but i haven't found any useful, anything which has an effect on this.

Anyone has any ideas for this?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Compiling with Visual Studio 2010, and related
« Reply #1 on: October 13, 2012, 11:34:43 am »
You should be able to, but you'll need to get the source code for all those projects and compile them as such. The option should be amongst the project settings

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
« Last Edit: October 13, 2012, 11:50:29 am by radius75 »

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #3 on: October 13, 2012, 01:07:36 pm »
Ok. Is there any way to link statically without getting all the sources of yaml, etc ?
*.lib files are actually present in the precompiled version, theoretically shouldn't they be enough for static linking?

If downloading all the sources can not be avoided, then, is there a complete pack somewhere, which contains ALL (yaml, SDL, etc) the source files?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Compiling with Visual Studio 2010, and related
« Reply #4 on: October 13, 2012, 01:50:23 pm »
No, .lib files do not contain code, they only contain definitions. .obj files contain the code, but I think depending on how they were built is whether you can link them. It's been a while since I manually had to play with linkers.

There isn't a complain pack AFAIK, you'll have to visit each site seperately.

I always find dependancies are the most tedius aspects of joining a project, esp' when the libraries don't give you a pre-compiled version and don't have a project file for your compiler. Thankfully, the task is generally a one-time thing

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #5 on: October 14, 2012, 05:11:38 pm »
I always find dependancies are the most tedius aspects of joining a project, esp' when the libraries don't give you a pre-compiled version and don't have a project file for your compiler. Thankfully, the task is generally a one-time thing
Oh gawd dependencies are a nightmare. I remember back in Xenocide we even had to make a whole separate program just to handle them. :P OSS has too much of a DIY approach. "Oh you wanna use your library, you gotta earn it". So you end up with everyone reinventing the wheel because nobody wants to dig into all the stuff out there. If your software is open-source then being easy to compile is as important as being easy to use! I'm not gonna bother if the time I gain from using an existing library is wasted in getting it to work.

So with OpenXcom I set off from the start to make everything as simple as possible, source is simple, compiling is simple, instructions are simple, and dependencies are pre-compiled. And I still stress horribly everytime I have to consider another dependency, like now I'm looking for a good logging/debugging library.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #6 on: August 23, 2013, 12:07:32 pm »
Latest builds compiles with errors.
I really cannot understand what's wrong with templates:

https://github.com/SupSuper/OpenXcom/blob/master/src/Ruleset/Unit.h#L105
https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/Position.h#L80
https://github.com/SupSuper/OpenXcom/blob/master/src/Ruleset/RuleRegion.h#L112
https://github.com/SupSuper/OpenXcom/blob/master/src/Ruleset/AlienDeployment.h#L96

VC 2010 writes:
Code: [Select]
1>d:\git\openxcom\src\savegame\../Ruleset/Unit.h(105): error C2143: syntax error : missing ';' before '<'
1>d:\git\openxcom\src\savegame\../Ruleset/Unit.h(105): error C2913: explicit specialization; 'YAML::convert' is not a specialization of a class template
1>d:\git\openxcom\src\savegame\../Ruleset/Unit.h(105): error C2059: syntax error : '<'
1>d:\git\openxcom\src\savegame\../Ruleset/Unit.h(106): error C2143: syntax error : missing ';' before '{'
1>d:\git\openxcom\src\savegame\../Ruleset/Unit.h(106): error C2447: '{' : missing function header (old-style formal list?)
1>d:\git\openxcom\src\battlescape\Position.h(101): error C2913: explicit specialization; 'YAML::convert' is not a specialization of a class template
1>d:\git\openxcom\src\./Ruleset/RuleRegion.h(135): error C2913: explicit specialization; 'YAML::convert' is not a specialization of a class template
1>d:\git\openxcom\src\./Ruleset/RuleRegion.h(155): error C2913: explicit specialization; 'YAML::convert' is not a specialization of a class template
1>d:\git\openxcom\src\./Ruleset/AlienDeployment.h(113): error C2913: explicit specialization; 'YAML::convert' is not a specialization of a class template

Anybody know, what is wrong?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #7 on: August 23, 2013, 05:22:06 pm »
Do you have the new dependencies with yaml-cpp 0.5?

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #8 on: August 23, 2013, 11:50:01 pm »
OMG! New headers!

Thank you. Now everything OK.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Compiling with Visual Studio 2010, and related
« Reply #9 on: May 07, 2015, 03:58:21 pm »
Right. Sorry for the Necro posting, but it felt better than starting an new thread.

Just wanted to pass along my observations from setting up to compile for the first time, and a warning: 

Don't bother trying to compile in 64bit.  It is just not worth the hassle.  I wasted too many hours, and never got it working.

Simply follow the wiki, download VS 2010 Express, etc, open the solution, ignore warning about the project being set up for 64bit, and just compile it.  It will make your life so much easier. :)

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #10 on: May 07, 2015, 05:41:32 pm »
Don't bother trying to compile in 64bit.  It is just not worth the hassle.  I wasted too many hours, and never got it working.
This was my conclusion too when setting up a windows environment for testing the mod layout changes.  64-bit builds on Linux and OSX are easy peasy, but on Windows it's just not worth it.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Compiling with Visual Studio 2010, and related
« Reply #11 on: May 08, 2015, 10:34:54 pm »
Works for me. :P Let me know if you ever need any 64-bit Windows testing, though it's rare you'll get different behavior from 32-bit.