11. October 2016

Siriel 05 – Open source game engines

After working with Unity Editor I have realized that it has several drawbacks from my point of view.

  • Build time for HTML5 was extremely long even when the game was very small. It took several minutes to build the application.
  • Personal license always displays logo of Unity and I had to wait for the logo to fade out even when doing small iterations and testing of the game.
  • Unity is close source and even when I found the bug, Unity QA was not able to simulate it and they dropped the issue.

I started to seek for other engines and I was surprised by myriad of engines described at Wikipedia. The list is quite exhaustive and it is little bit hard to recognize the maturity of each project.

There is another list at GitHub which contains just open source engines. Projects are sorted by stars which makes it easier to see how is the project popular.

14. October 2011

_ITERATOR_DEBUG_LEVEL’: value ‘0’ doesn’t match value ‘2’

Update 16.10. 2011: new information added to article.

I was trying to compile an application with Visual Studio 2010 which has some dependency on GDAL open source library.

Everything went ok. GDAL compiled without problem from VS and also from command line:

nmake -f makefile.vc MSVC_VER=1600 DEBUG=1

Compilation of application based on GDAL was also ok. The only problem was when I switched project from Release mode to Debug mode. Linker was throwing a lot of messages like this:

'error LNK2038: mismatch detected forĀ _ITERATOR_DEBUG_LEVEL': 
value '0' doesn't match value '2' in vrtizer.obj

I found some explanation that new version of VS has _ITERATOR_DEBUG_LEVEL set to 2 in Debug mode. It means that there are some extra security controls over iterators to detect memory leaks and other problematic stuff with iterators.

After longer research I came to realization that GDAL is compiled with /MD switch and my application wasn’t. The solution was easy. I just added /MD and Debug mode of app start working like a charm.

Quote from MSDN about /MD compiler switch:

Defines _MT and _DLL so that both multithread- and DLL-specific versions of the run-time routines are selected from the standard .h files. This option also causes the compiler to place the library name MSVCRT.lib into the .obj file.
Applications compiled with this option are statically linked to MSVCRT.lib. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCR71.DLL, which must be available at run time to applications linked with MSVCRT.lib.

Update 16.10. 2011

/MD solved problem, but there was another warning: Command line warning D9025: overriding ‘/MDd’ with ‘/MD’.

To solve Iterator issue for GDAL you need to compile DEBUG version of gdal.lib with switch /MDd instead of default /MD.

Just open nmake.opt file and replace /MD in lines with DEBUG definition by /MDd.

There are two lines with MD:

OPTFLAGS= $(CXX_ANALYZE_FLAGS) /nologo /MDd /EHsc /Zi /W4 /D_CRT_SECURE_NO_DEPRECATE 
/D_CRT_NONSTDC_NO_DEPRECATE /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb /DDEBUG
OPTFLAGS=   /nologo /MDd /EHsc /GR /Zi /W4 /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb  /DDEBUG

Then rebuild GDAL:

nmake -f makefile.vc clean
nmake -f makefile.vc MSVC_VER=1600 DEBUG=1