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.
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.
somewhere at the beginning of main (eg. CMT.cpp line 201). Does it outputs 2328 (it should)? If not, outprint the actual working folder:
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.
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.
Creating console and logfile: 0
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:
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)