OpenXcom Forum
OpenXcom => Troubleshooting => Topic started by: sylandro 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:
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?
-
the pre-compiled dependencies provided are for 2010 and 2013. you'll need to build your own for 2015.
-
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/)
-
I thought so. I got confused because the Visual Studio link in the wiki redirects to the 2015 download link.
Thanks!
-
Ok, I switched to VS2010 express and now it builds, but whenever I try to run the application I get the following error:
Unhandled exception at 0x005986dc in OpenXcom.exe: 0xC0000005: Access violation reading location 0xabababab.
It breaks in the following line in impl.h:
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?
-
** 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
-
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.
-
Thanks for the prebuilt dependancies, I tried to build the project but I got alot of std::min and std::max identifier not found.
-
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.
-
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 ;)
-
I have created a pull request for the changes.
https://github.com/SupSuper/OpenXcom/pull/1086
-
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
-
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
-
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?
-
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 (https://openxcom.org/download/dev/openxcom-deps-win-vc2017.zip) (2 MB)
-
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,
-
Did you get anything similar?
No, not really.
Actually, it all went extremely smooth for me... everything worked on the first try.
-
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!
-
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.
-
What am I doing wrong when it comes to the yaml dll and lib.
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.
-
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.
-
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:
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?
-
Which commit exactly did you check out from the repo?
Just to confirm you have the correct repo, correct branch and correct commit :)
-
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.
-
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...
-
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 ?
-
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.
-
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 (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 (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
-
You don't seriously expect anything made in 2015 to merge without issues, do you?
-
of course you're right ::)
-
I found RuleBaseFacility in mod folder ... do you have any idea about position/new name of ruleset.h,.cpp ?
-
New name is Mod.h,.cpp
-
thanks
-
I returns on this topic ... ::)
I merged redv's branch
but where is now #include "../Resource/ResourcePack.h" ?
Thanks
-
No offense, but for such questions, you can just look into git history same as anyone else... nobody remembers stuff like that.
FWIW ResourcePack.h is now mostly inside Mod.h
-
I apologize for the questions :-[.. I do not have experience of GIT :-\...
--- Posts merged ---
Thanks to your help I managed to recompile without errors
:)
May I put user/mods folder into development folder ?
I tried at the same level of UFO folder, into bin but it was not loaded