aliens

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

Offline snicmtl

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #15 on: March 08, 2017, 09:05:38 pm »
Nicely done Meridian!

I was working on this all night trying to wrap my head around it.

Got all the deps compiled but am/was hitting a wall with unresolved externals re: SDL

( ieError   LNK2001   unresolved external symbol _IID_IDirectDrawSurface3   OpenXcom   C:\dev\OpenXcom\src\SDL.lib(SDL_dx5yuv.obj)   1   
 )

I feel I'm so close, I'd love to complete the work without using the premade package.

Did you get anything similar?



PS: Love the cmake import in VS2017

Cheers,

snicmtl
Cheers,

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Need help compiling under Windows/VS2017
« Reply #16 on: March 08, 2017, 09:40:35 pm »
Did you get anything similar?

No, not really.
Actually, it all went extremely smooth for me... everything worked on the first try.

Offline snicmtl

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #17 on: March 08, 2017, 10:10:17 pm »
Thanks for the quick reply. It turns out it needed the DirectX libs/SDK.  Compiled great once that was intalled/pointed to .

Also, it now compiles without the YAML_DLL_CPP preprocessor directive that was needed with VS2015, though unsure if that is because I went ahead and compiled yaml itself, or just from the switch to VS2017.

Cheers!

Offline MadHaTr

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #18 on: April 12, 2017, 08:45:23 am »
I am warming back up by attempting to compile oxc(https://github.com/SupSuper/OpenXcom) in VSC++ 2017, I received the error which seems most common for builds in 2015 having to do with non updated deps.  Which sent me on a side adventure to compile the deps myself. Starting which YAML, I seem to have made a mistake.

I clone the git(https://github.com/jbeder/yaml-cpp) (I'm pretty new to git) I run cmake for VSC++ 2017, get my SLN file and compile in VS, everything works great but I don't get the yaml files I am after. I also don't get and DLL's.  This is the only LIB file received. (libyaml-cppmd.lib) which was 1.7MB, way larger than what I see you guys using so I know it is not just renamed.

What am I doing wrong when it comes to the yaml dll and lib.


Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Need help compiling under Windows/VS2017
« Reply #19 on: April 12, 2017, 10:16:48 am »
What am I doing wrong when it comes to the yaml dll and lib.

Code: [Select]
mkdir sandbox
cd sandbox
git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
cd build
cmake -G"Visual Studio 15" -DBUILD_SHARED_LIBS=TRUE -DCMAKE_DEBUG_POSTFIX="d" ..

... then open visual studio 2017 solution and build both debug and release.

Offline MadHaTr

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #20 on: April 12, 2017, 04:33:04 pm »
I'll give this a try, seems the only thing that is different is I was not selecting the shared option.

Edit: Correction I did have the shared option selected.  Though I used windows cmake and it had 2 other options selected as well, maybe one of them messed it up or this -DCMAKE_DEBUG_POSTFIX="d" option made the difference.  I don't know. Worked the same as last time though now I have the yaml dll.

Thanks.  I'll move on to compiling the other deps now.

Edit2: Wanted to go back and try again with the windows cmake, and no I did not have the shared libs selected... hence no dlls.
« Last Edit: April 12, 2017, 05:01:42 pm by MadHaTr »

Offline Arbuckle

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #21 on: October 04, 2017, 10:35:12 pm »
I've downloaded the latest openxcom extended sources and tried to compile them with VS2017 + the 2017 precompiled dependencies that Meridian posted here and got these errors:
Code: [Select]
1>AIModule.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>Map.obj : error LNK2001: unresolved external symbol "public: void __thiscall OpenXcom::ItemSprite::drawShadow(class OpenXcom::BattleItem *,int,int,bool)" (?drawShadow@ItemSprite@OpenXcom@@QAEXPAVBattleItem@2@HH_N@Z)
1>Map.obj : error LNK2001: unresolved external symbol "public: void __thiscall OpenXcom::ItemSprite::draw(class OpenXcom::BattleItem *,int,int,int,bool)" (?draw@ItemSprite@OpenXcom@@QAEXPAVBattleItem@2@HHH_N@Z)
1>Map.obj : error LNK2001: unresolved external symbol "public: __thiscall OpenXcom::ItemSprite::~ItemSprite(void)" (??1ItemSprite@OpenXcom@@QAE@XZ)
1>Map.obj : error LNK2001: unresolved external symbol "public: __thiscall OpenXcom::ItemSprite::ItemSprite(class OpenXcom::Surface *,class OpenXcom::Mod *,int)" (??0ItemSprite@OpenXcom@@QAE@PAVSurface@1@PAVMod@1@H@Z)
1>C:\Users\username\Desktop\New Folder\OpenXcom-OpenXcomExtended\src\..\bin\Win32\Release\OpenXcom.exe : fatal error LNK1120: 5 unresolved externals

So I guessed that there might be a problem with my precompiled YAML dll, so I compiled both the 0.51 and the newest commit and tried both.  And I got the same errors.

Any ideas?
« Last Edit: October 04, 2017, 10:39:48 pm by Arbuckle »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #22 on: October 04, 2017, 11:34:52 pm »
Which commit exactly did you check out from the repo?

Just to confirm you have the correct repo, correct branch and correct commit :)

Offline Arbuckle

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #23 on: October 05, 2017, 06:23:17 pm »
Well shit, I dowloaded both masters from OXCE and OXCE+ just to make sure I had the masters and now they both compiled without any problems. Seems I didn't have the correct repo/branch/commit, thanks.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #24 on: October 05, 2017, 06:56:41 pm »
Well shit, I dowloaded both masters from OXCE and OXCE+ just to make sure I had the masters and now they both compiled without any problems. Seems I didn't have the correct repo/branch/commit, thanks.

But the master branch of OXCE+ is identical with vanilla OpenXcom.

If you want the real thing, you need the "oxce3.5-plus-proto" branch...

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: Need help compiling under Windows/VS2017
« Reply #25 on: May 26, 2018, 07:42:51 pm »
Hi Meridian,  after some years I wish I compile openxcom again...

I downloaded VS2017 community edition,
I cloned your github repo
I downloaded your dist of deps
I recompile it with some trouble about deps include/lib folders

There is a post with a tutorial about prepare a development image ?


« Last Edit: May 26, 2018, 11:38:13 pm by davide »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Need help compiling under Windows/VS2017
« Reply #26 on: May 26, 2018, 09:11:34 pm »
There is no specific post with such details.
VS2017 is enough, you don't need any other tools.
After cloning my repo, don't forget to switch to branch "oxce3.5-plus-proto" (i.e. not master)
You need to extract the dependencies into root directory, see attached screenshot.
After that just open the solution in VS and click Compile.
« Last Edit: May 26, 2018, 09:13:43 pm by Meridian »

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #27 on: May 26, 2018, 11:45:22 pm »
Thanks, now I compiled without error.

I have some trouble with GIT ...

I tried to merge into your repo an old experiment of redv :
https://openxcom.org/forum/index.php/topic,3513.msg42933.html#msg42933
the source code in conceptually clear:
https://github.com/SupSuper/OpenXcom/compare/master...redv:active_base_defense

... but today some file do not exist anymore ...or them were be renamed
Them are Ruleset/Ruleset.h,.cpp and Ruleset/RuleBaseFacility.h,.cpp
« Last Edit: May 26, 2018, 11:53:45 pm by davide »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #28 on: May 27, 2018, 12:10:33 am »
You don't seriously expect anything made in 2015 to merge without issues, do you?

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: Need help compiling under Windows/VS2015
« Reply #29 on: May 27, 2018, 12:16:10 am »
of course you're right ::)