Instalation help

I have a link error in VC++ 2010 and no idea where it comes from.

LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-gd-1_51.lib'

My boost files are called boost_*****.lib. So where is this coming from?

Note: At linker search directories there are some inherited values like “D:\Programme\boostXXX\stage\lib” that should not be there.

Non-related note: zdll.lib is missing from the lib pack provided.

I had similiar problems. Just find this file and add it’s path to linker directories as another entry.

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?

EDIT: Properties->Linker->Input->Additional Dependencies

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.

It’s stored on my computer :P. Did I submit local project settings by mistake?

The issue is, if I do it, I can’t revert - or I will loose my local settings.

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.

That is, I use different configuration on my own computer than recommended one and I don’t want to break them either, as it’s troubleosme to fix.

The simplest is just let someone with proper settings (Two, probably Tow Dragon) to commit it.

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 :stuck_out_tongue: )

Here a list with all the problematic paths I found: Maybe it helps

Some of the libs are generated outside of VCMI folder itself!

Fix: Project_Properties->Configuration_Properties->General->OutputDirectory=$(SolutionDir)\<desired path>

There are local paths in Additional Linker Libraries and Compiler Includes

Fix: Project_Properties->Configuration_Properties->Linker->%Additional Library Directories=%(AdditionalLibraryDirectories)
Fix: Project_Properties->Configuration_Properties->c/C++->Additional Include Directories=%(AdditionalIncludeDirectories)

Since you do not take heed of warnings, why not commit also your exclude warnings list?

Last issue (I hope).

When building VCMI_Client I get some strange linker errors, and it is not wrong folders. Some discussions here .

To sum it up I used Multithreaded debug/DLL version of boost. What should I have been using?

1>Link:
1>     Creating library D:\Temp\VCMI\\lib\VCMI_client.lib and object D:\Temp\VCMI\\lib\VCMI_client.exp
1>CMT.obj : error LNK2001: unresolved external symbol "public: static unsigned int const boost::program_options::options_description::m_default_line_length" (?m_default_line_length@options_description@program_options@boost@@2IB)
1>CMT.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > boost::program_options::arg" (?arg@program_options@boost@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
1>D:\Temp\VCMI\\lib\VCMI_client.exe : fatal error LNK1120: 2 unresolved externals
1>
1>Build FAILED.

No success in running the client :(.

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.

Any ideas?

Usually I would say that this is normal - this is file where VCMI stores your local settings, it should be created on first start.

Not a Windows user myself so this is only guesses but:

  • Check if working directory is set to you H3 directory
  • Check if vcmi has write access to it (needed to write settings)
  • Check if vcmiclient and vcmiserver are in same directory which is your H3 dir (needed to start map)

It is not file access although I have checked all your points.

To me is looks like a pointer to a global variable: “settings” is not pointing to the right place.

CMY.cpp LIne 254 conf.init(); has inside

const JsonNode& screenRes = settings"video"]"screenRes"];

and works. If I insert the same code just after conf.init(); call it returns bad pointer.

Compiler does not complain.

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)

  1. Delete config/settings.json if it showed up.
  2. Add
tlog0 << boost::filesystem::file_size("config/defaultSettings.json") << std::endl;

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%");
  1. Rebuild solution. (that helped me “fix” quite a number of most bizarre bugs).
  2. Paste here (or via some pastebin) the whole contents of your VCMI_Client.log.
  3. 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.

  1. Stack Trace Call Stack
  2. config/settings.json never created.
  3. config/defaultSettings.json filesize 2328 like expected.
  4. Cleaned and rebuilded a couple of times. (After my first 2 points are cleared I will do a fresh checkout and rebuild from there)
  5. VCMI_Vlient.log
  6. Output.txt
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)

BoostPro 1.51.0 Installer (32-bit) from here. And as choice Multithreaded debug DLL not static. My bad.

I am rebuilding everything. Will report back.

Looks better now. I have the right boost and proj files are clean.

One error on compiling:

4>------ Build started: Project: StupidAI, Configuration: Debug Win32 ------
4>Build started 12/19/2012 3:26:51 PM.
3>Build started 12/19/2012 3:26:51 PM.
3>InitializeBuildStatus:
3>  Creating "Debug\ERM.unsuccessfulbuild" because "AlwaysCreate" was specified.
4>InitializeBuildStatus:
4>  Touching "Debug\StupidAI.unsuccessfulbuild".
4>ClCompile:
4>  StdInc.cpp
3>ClCompile:
3>  StdInc.cpp
4>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(776): error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm110' or greater
4>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(776): fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit
4>
4>Build FAILED.

Added command line “/Zm200” to VCMI_lib and 2 others and it compiles. (No idea why is needed. here it says it is rarely needed…)

VCMI_Client -> Working Dir changed from $(ProjectDir) to $(OutDir). (Can someone explain why this is needed?)

When I run first time the program it complains about missing stuff from Data

readToVector("DATA/ZCRGN1.TXT",   creGens);

. From manual I found a link to english package to put in DATA folder. That one fixed the problem.

When I try to start map Test2012 it fails at

CGP->showLoadingScreen(boost::bind(&startGame, si, (CConnection *)nullptr));

Call Stack

Is it because of WoG? How can I disable WoG completely?[/code]

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?