aliens

Author Topic: Need help compiling under Windows/VS2015  (Read 21901 times)

Offline sylandro

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Need help compiling under Windows/VS2015
« on: August 31, 2015, 08:32:45 am »
I'm having problems compiling under Visual Studio 2015. I downloaded the dependencies from the wiki and added them to the deps folder, but I get the following error while the build process is linking:

Code: [Select]
Error LNK2001 unresolved external symbol __imp____iob_func OpenXcom G:\Documentos\Workspace\Git\openxcom\src\SDLmain.lib(SDL_win32_main.obj) 1
What am I doing wrong?
« Last Edit: March 03, 2016, 05:51:33 pm by SupSuper »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #1 on: August 31, 2015, 10:58:00 am »
the pre-compiled dependencies provided are for 2010 and 2013. you'll need to build your own for 2015.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #2 on: August 31, 2015, 12:33:13 pm »
VS2015 has some breaking C/C++ changes so you'll likely have to compile SDL yourself (https://www.gamedev.net/topic/664434-problem-installing-sdl-in-visual-studio-2015/)

Offline sylandro

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #3 on: August 31, 2015, 04:31:34 pm »
I thought so. I got confused because the Visual Studio link in the wiki redirects to the 2015 download link.

Thanks!

Offline sylandro

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #4 on: September 06, 2015, 05:10:21 am »
Ok, I switched to VS2010 express and now it builds, but whenever I try to run the application I get the following error:

Code: [Select]
Unhandled exception at 0x005986dc in OpenXcom.exe: 0xC0000005: Access violation reading location 0xabababab.
It breaks in the following line in impl.h:

Code: [Select]

for(node_map::const_iterator it=m_map.begin();it!=m_map.end();++it) {
if(equals(*it->first, key, pMemory))
return *it->second;
}

Any ideas why this might be happening?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #5 on: December 26, 2015, 11:42:54 am »
** IMPORTANT: the linked files are provided as is, without any guarantee, use at your own risk! **

Hi all,

this was frikkin' complicated... but after many hours (and big help from my little brother!) I was able to compile OpenXcom in VS2015.

1/ the new precompiled dependencies (32bit, Release and Debug) can be downloaded here: link removed (2 MB)

2/ there was still a problem with compiling OpenXcom (same as here: https://github.com/jbeder/yaml-cpp/issues/332)

I solved it by adding "YAML_CPP_DLL" in OpenXcom project properties > Preprocessor definitions... there is probably a much better way to do it, but I leave that to SupSuper once he creates official dependencies and compilation instructions. See attached screenshot.

Enjoy!

Regards,
Meridian (and brother)

EDIT: versions used to compile dependencies:
  SDL: 1.2.15
  SDL_gfx: 2.0.25
  SDL_image: 1.2.12
  SDL_mixer: 1.2.12 (libmikmod: master from February 2016)
  yaml: master from 18th November 2016, doesn't need Boost anymore! requires C++11 though
« Last Edit: August 28, 2024, 09:54:56 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #6 on: February 28, 2016, 05:09:31 pm »
Updated previous post with new pre-compiled deps for vs2015.

Changes:
 - recompiled libmikmod ... old one was causing crashes
 - new yaml-cpp ... doesn't require boost now, but requires C++11
 - new yaml-cppd

PS: this time yaml-cppd is causing issues (debug mode only), but at least I can compile in release mode... will look at the debug later Debug works too now.
« Last Edit: November 20, 2016, 10:14:52 am by Meridian »

Offline harre

  • Sergeant
  • **
  • Posts: 45
    • View Profile
Re: Need help compiling under Windows/VS2010
« Reply #7 on: March 01, 2016, 02:33:13 am »
Thanks for the prebuilt dependancies, I tried to build the project but I got alot of std::min and std::max identifier not found.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #8 on: March 01, 2016, 09:18:22 am »
Thanks for the prebuilt dependancies, I tried to build the project but I got alot of std::min and std::max identifier not found.

That's caused by the newest version of yaml-cpp, more info here: https://openxcom.org/forum/index.php/topic,4313.0.html
Just add the #include <algorithm> everywhere you see the error.

Offline harre

  • Sergeant
  • **
  • Posts: 45
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #9 on: March 03, 2016, 01:50:26 am »
That's caused by the newest version of yaml-cpp, more info here: https://openxcom.org/forum/index.php/topic,4313.0.html
Just add the #include <algorithm> everywhere you see the error.

Cool, I got it compiled and running now. Thanks..

Now I need to get time to dig some in the code, I need to make a own fork and then I can make a pull request for the include fixes for yaml-cpp ;)

Offline harre

  • Sergeant
  • **
  • Posts: 45
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #10 on: March 04, 2016, 12:22:49 am »
I have created a pull request for the changes.

https://github.com/SupSuper/OpenXcom/pull/1086

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #11 on: November 20, 2016, 10:18:05 am »
I have tried with the newest yaml-cpp and now Debug works for me too, yay!

Download of updated pre-compiled dependencies for Visual Studio 2015: link removed
« Last Edit: August 28, 2024, 09:55:55 pm by Meridian »

Offline harre

  • Sergeant
  • **
  • Posts: 45
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #12 on: November 22, 2016, 12:56:55 am »
Cool, I'll try it out next year  8) Now I'm swamped at work and home with kids for the rest of the year

Offline tylor

  • Captain
  • ***
  • Posts: 53
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #13 on: January 03, 2017, 09:57:50 pm »
I have tried to compile https://github.com/MeridianOXC/OpenXcom/tree/oxce3.5-plus-proto with the deps you provided, and it worked perfectly. But only in Debug version. Release one could not find windows.h, gl.h and glu.h. Is it hard to fix it?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help compiling under Windows/VS2017
« Reply #14 on: March 08, 2017, 07:02:17 pm »
1/ the new precompiled dependencies (32bit, Release and Debug) can be downloaded here: link removed (2 MB)

2/ there was still a problem with compiling OpenXcom (same as here: https://github.com/jbeder/yaml-cpp/issues/332)

I solved it by adding "YAML_CPP_DLL" in OpenXcom project properties > Preprocessor definitions... there is probably a much better way to do it, but I leave that to SupSuper once he creates official dependencies and compilation instructions. See attached screenshot.

EDIT: versions used to compile dependencies:
  SDL: 1.2.15
  SDL_gfx: 2.0.25
  SDL_image: 1.2.12
  SDL_mixer: 1.2.12 (libmikmod: master from February 2016)
  yaml: master from 18th November 2016, doesn't need Boost anymore! requires C++11 though

If anyone's interested, Visual Studio 2017 is out since yesterday and I've prepared the pre-compiled dependencies (32bit, Release and Debug):

  SDL: 1.2.15
  SDL_gfx: 2.0.25
  SDL_image: 1.2.12
  SDL_mixer: 1.2.12 (replaced libmikmod with v3.3.10 from August 2016)
  yaml: master from 8th March 2017 (0fdb1b9), doesn't need Boost anymore! requires C++11 though

Download: openxcom-deps-win-vc2017.zip (2 MB)
« Last Edit: August 28, 2024, 09:56:13 pm by Meridian »