To quickly get rid of the error coming from lib in front of boost I just made another copy of all boost dll’s with lib suffix. (Should be tracked and fixed imo).
Now I stumbled upon:
LINK : fatal error LNK1104: cannot open file 'G:\Programowanie\VCMI\AI\FuzzyLite.lib'
Were is this info stored? I cannot find it in the usual places. It is in the proj files but how to edit it out?
EDIT2: Output directory for FuzzyLite is outside of VCMI project:
..\..\..\AI
All these minor stuff takes a lot of time for a beginner to figure out and repair. Would be very useful if someone took the time and fixed all this stuff.
I do not know what you mean “I can’t revert”. (.proj files are in SVN). But why would you want to revert? You would like to fix it no? :D. Imagine that everyone will get new proj files that will overwrite their local settings :(.
I would suggest do a fresh checkout from SVN in another sandbox and fix from there. And everyone updates.
EDIT: I just saw your post that you are the only one who was supposed to have these. (I am in no position to teach you, but maybe you should reorganize your local stuff )
Here a list with all the problematic paths I found: Maybe it helps
Some of the libs are generated outside of VCMI folder itself!
First there is no config/settings.json file. (do not know if it matters). And then it crashes in {main() CMT.cpp line 270}. Something related with bad memory allocation for settings variable I think.
It is too complicated for me for a quick debug and I am not interested in that part atm, I just want it running.
The current project files are a mess. I am going to replace them with new ones soon but they’ll be for VS2012. Sorry for the inconvenience.
It seems that there is no config/settings.json in your working directory.
How are you running VCMI?
If this is by “Start debugging” command (or F5) then mind that VCMI will use as its folder whatever is given as the Working directory in properties of VCMI_Client project (Configuration properties -> Debugging sheet). Check value of this setting and adjust it if needed.
Under working directory there should be both config and game data.
settings is a global object, no pointers are involved. Most likely it just failed to initialize properly due to missing files.
I do everything like you say. And settings initializes because const JsonNode& screenRes = settings"video"]“screenRes”]; works inside conf.init(); and right outside is not working.
I have the same suspicion, that some directory is not set correctly by me. For this it is important that trunk is solid. I would suggest someone checks out in a new location and brings VCMI to run from there. Then commits back to repository. I will wait for that. My hurry is because I have free time over the holidays so it would be nicer to be done sooner rather than later.
PS. As for VC++2012…if you have no “reason” to change then do not. Everyone will have to upgrade. If people work on more than 1 project they will end up with 2 versions of VS. And right now you can easily find help for 2010. Not so much for 2012 if past is an indicator.
By “works” you mean “doesn’t crash” or “returned object is filled with sensible values”? Set the breakpoint at SetResolution (CConfigHandler.h line 174) and check the values of arguments.
Please try the following:
0. You said VCMI crashes at line 270 in CMT.cpp. Can you paste the full stacktrace? (Debug -> Windows -> Call Stack; Ctrl+A, Ctrl+C work fine)
somewhere at the beginning of main (eg. CMT.cpp line 201). Does it outputs 2328 (it should)? If not, outprint the actual working folder:
std::system("echo %cd%");
Rebuild solution. (that helped me “fix” quite a number of most bizarre bugs).
Paste here (or via some pastebin) the whole contents of your VCMI_Client.log.
Redirect console to another file. In the client project properties -> Debugging -> Command arguments add 1> output.txt 2>&1. Paste the contents of output.txt.
Within a few months I’d like to drop support for VC10 (waiting for better C++11 compliance). For that time you can still use VC10. I’ll check how much trouble it is to convert project fiels VC11 -> VC10, maybe it’s just a version number. AFAIK all other developers in the project already upgraded. (or they were silent about it)
VS2012 (like the previous ones) can work with the older compiler (not sure if the previous VC needs to be installed or if the platform SDK is enough). VS2010 cannot work with the newer compiler.
Before answering to your “requests” let me tell you my guesses that come from the problems I had compiling.
VCMI_CLIENT runtime MultiThreadedDebug ! instead of MultiThreadedDebugDLL ! (with the apropriate boost libraries.) Had to change this in the client otherwise it did not compile. (see link 2-3 posts above). Having mixed libraries does not sound good at all. Maye I change all to MultiThreadedDebug?
I run VCMI in debug from chekout dir. I am not sure about output dirs for subprojects. Here what I have.
output dirs:
BattleAI - $(SolutionDir)\AI\
ERM - $(SolutionDir)\Scripting\
FuzzyLite - $(SolutionDir)\AI ???
StupidAI - $(SolutionDir)\AI
VCAI - $(SolutionDir)\AI
VCMI_lib - $(SolutionDir) ???
VCMI_Client - $(SolutionDir)
VCMI_Server - $(SolutionDir)
When someone can confirm these 2 points (first one especially) I can do a fresh checkout and retry from there.
Additional point… Do I still need WOG? Is it a full mod now that can be disabled, like it should?
Now to trials…
JsonNode& screenRes = settings"video"]“screenRes”]; working means I see 800*600 set inside. Outside of conf.init(); it just says that “settings” variable does not exist.
Starting...
Creating console and logfile: 0
Initialization: 109
Data loading: 3803
Mod handler: 0
Mod VCMI essential files enabled
Mod In The Wake of Gods enabled
Mod filesystems: 31
Basic initialization: 3943
Failed to open file
Last system error was : Invalid argument
Loading settings: 4368
VCMI 0.9 (client)
That’s absolutely bad and likely source of your problems. Without runtime in DLL, both lib and client get their own runtimes and then crazy things (like yours) happen at the modules booundary.
Runtime has to be Multithreaded debug DLL for debug configuration and multithreaded DLL for release (RD) configuration. Never anything else.
I’m not sure how have you installed Boost (you were getting linker errors with it) but my recommendation would be to build it again. To start with the fact taht your libs were named booost_* instead of libboost_* was suspicious. (have you DLL version of Boost instead of static?)
Get rid of your trunk folder. Check it out again. Make sure that next to it include and libs subfolders are present and contain stuff from my libraries pack (linked at wiki). Use package attached to my post to overwrite your solution/project files. They should work with VC10 and neatly detect everything except your Boost installation.
Get rid of your Boost installation and build it clean. Grab the latest package ( sourceforge.net/projects/boost/f … z/download ), extract it somewhere. Let’s assume it is C:\C++. Then open the command prompt and paste the following:
cd "C:\C++\boost_1_52_0"
bootstrap
.\b2
b2 address-model=32 --toolset=msvc-10.0 --stagedir=./stage32
Wait till it builds. C:\C++\boost_1_52_0\stage32\libs should now contain folder libs with libbost_*.lib (two files for each library — debug and release version). Add your new Boost paths to the VCMI_global.props (you can acccess it via property manager as described in the wiki).
Try building. It works for me. Please tell your the result. Don’t rename anything nor change anything in the project files except of providing additional paths in the .props file. VCMI_VC10.7z (6.12 KB)
You can’t. WoG multimedia and config data are closely tied with H3 data and they are handled together. Thus VCMI requires WoG or ERA installation to run.
I thought VCMI is H3 SOD + mods (WoG HotA etc). I find it curious to be H3 WoG + mods… But probably you have your reasons.
Nevertheless I want to compile where I build. What do I need to copy? In wiki there are mentioned only some H3 files. Should I just install WoG in trunk?