Jump to content

UnigineMathLib.h


photo

Recommended Posts

Problem

 

Double precision compile fails due to UNIGINE_DOUBLE define in file include/UnigineMathLib.h. I think it should be USE_DOUBLE as in the rest of the source code.

 

...
#ifndef __UNIGINE_MATHLIB_H__
#define __UNIGINE_MATHLIB_H __
...
#ifdef UNIGINE_DOUBLE                           // most probably USE_DOUBLE
#define UNIGINE_SCALAR	double
#define UNIGINE_VEC3	Unigine::dvec3
#define UNIGINE_VEC4	Unigine::dvec4
#define UNIGINE_MAT4	Unigine::dmat4
#else
#define UNIGINE_SCALAR	float
#define UNIGINE_VEC3	Unigine::vec3
#define UNIGINE_VEC4	Unigine::vec4
#define UNIGINE_MAT4	Unigine::mat4
#endif
...

Link to comment

use scons to build engine. I never met this problem. :D

 

We use VisualC++ 2008 for fast IDE programming/debug cycles and there this is an issue. BTW there is another issue when using utils/VCProj/unigine.bat. At least for VisualC++ 2008 the generated VisualStudio project files will fail during link both for debug/relase builds. We tracked it down to linker ignore_libraries template in unigine.py

 

....
ignore_libraries = string.replace('''
libcmt.lib                         # this causes linker errors, fixed by removal of libcmt.lib from ignore_libraries 
''','\n\t','')
....

Link to comment

I used the IDE to compile the engine, but I got so many problems, so after that, I'll never use IDE to compile engine

 

With above described fixes you just have to

 

  1. Start utils/VCProj/unigine.bat once. This will generate a unigine.vcproj VisualStudio project file in folder source/engine.
  2. Open this project with VisualStudio and you can compile UNIGINE DLL without any problems.
  3. Add some dll copy operation as post-build step for transfer of newly build unigine.dll versions from source/engine folder to lib folder
  4. Configure bin/main_x86/64d.exe as debug application in project settings

and than - bingo - you can edit, search, compile and debug UNIGINE engine completly from within Visual Studio IDE.

Link to comment
×
×
  • Create New...