So this gives me the solutions:
- Irrlicht (static lib, x64) (compiled with preprossecor macro _IRR_STATIC_LIB_)
- IrrlichtExtensions (static lib, x64)
- Sailors (exe, x64)
When starting earlier today I made this mess within two hours. First I got this same error as below thus adding _IRR_STATIC_LIB_ and getting the expected _ITERATOR_DEBUG_LEVEL mismatch. The iterator error kept coming back. Had to do with how I included the header files. Since the code worked properly I decided to reorganise and put the extensions into its own static library, easy to publish when the time comes.
Thus expecting the next compiiler error but I am failing to solve this. So my problem is simple; What am I forgetting?
(Excluding the 'IrrlichtExtensions.lib' and its header doesn't do anything visible.)
Regards,
edit: fixed typos
Code: Select all
1>cSailors.obj : error LNK2019: unresolved external symbol __imp_createDevice referenced in function "public: int __cdecl cSailors::Initialise(void)" (?Initialise@cSailors@@QEAAHXZ)
My static library: IrrlichtExtensionsCode: Select all
$(MY_LIBS_EXT)irrlicht\v1_8_4\lib\Win64-visualStudio\Irrlicht_static.lib $(MY_LIBS_EXT)irrlicht\v1_8_4\lib\Win64-visualStudio\Irrlicht_static_debug.lib $(MY_LIBS_EXT)irrlicht\v1_8_4\include\*.h
(compiles correctly in both, debug and release)
My executable: SailorsIrrlichtExtensions Property PagesFile: IrrlichtExtensions.hCode: Select all
// General: // Output Directory: $(SolutionDir)output\ // Intermediate: $(SolutionDir)intermediate\$(ProjectName)_$(Platform)_$(Configuration)\ // Target name (_DEBUG): $(ProjectName)_$(Platform)_$(Configuration) // Target name: $(ProjectName)_$(Platform) // C/C++ // General: // Additional include directories: $(MY_LIBS_EXT)$(MY_IRRLICHT)$(MY_IRRLICHT_VERSION)$(MY_IRRLICHT_INC); // $(MY_LIBS_EXT)$(MY_IRRLICHT)$(MY_IRRLICHT_VERSION)source\irrlicht\ // Code generation: // Runtime library (_DEBUG): Multi - threaded Debug( / MTd ) // Runtime library: Multi - threaded Debug( / MT ) // Linker // General // Additional library directories: $(MY_LIBS_EXT)$(MY_IRRLICHT)$(MY_IRRLICHT_VERSION)$(MY_IRRLICHT_LIB);
Code: Select all
#pragma once //#undef _ITERATOR_DEBUG_LEVEL //#define _ITERATOR_DEBUG_LEVEL 0 //#ifndef _IRR_STATIC_LIB_ #define _IRR_STATIC_LIB_ //#endif #include <irrlicht.h> #include "include\IExtendedGeometryCreator.h" #include "include\ISphereTerrainSceneNode.h" #include "source\CCapsuleSceneNode.h" #include "source\CExtendedGeometryCreator.h" #include "source\cIrrlichtExtensions.h" #include "source\CSphereTerrainSceneNode.h" #ifdef _DEBUG #pragma comment(lib, "Irrlicht_static_debug.lib") #else #pragma comment(lib, "Irrlicht_static.lib") #endif
(gives the compiler error)
Sailors Property Pages:File: Sailors.hCode: Select all
// General: // Output Directory: $(SolutionDir)output\ // Intermediate: $(SolutionDir)intermediate\$(ProjectName)_$(Platform)_$(Configuration)\ // Target name (_DEBUG): $(ProjectName)_$(Platform)_$(Configuration) // Target name: $(ProjectName)_$(Platform) // C/C++ // General: // Additional include directories: $(MY_LIBS_EXT)$(MY_IRRLICHT)$(MY_IRRLICHT_VERSION)$(MY_IRRLICHT_INC); // D:\dev\Projects\IrrlichtExtensions\IrrlichtExtensions\ // Code generation: // Runtime library (_DEBUG): Multi - threaded Debug( / MTd ) // Runtime library: Multi - threaded Debug( / MT ) // Linker // General // Additional library directories: $(MY_LIBS_EXT)$(MY_IRRLICHT)$(MY_IRRLICHT_VERSION)$(MY_IRRLICHT_LIB); // D:\dev\Projects\IrrlichtExtensions\output\
Sailors.cppCode: Select all
#pragma once //#undef _ITERATOR_DEBUG_LEVEL //#define _ITERATOR_DEBUG_LEVEL 0 //#ifndef _IRR_STATIC_LIB_ #define _IRR_STATIC_LIB_ //#endif #include <irrlicht.h> #include <IrrlichtExtensions.h> #ifdef _DEBUG #pragma comment(lib, "Irrlicht_static_debug.lib") #pragma comment(lib, "IrrlichtExtensions_x64_Debug.lib") #else #pragma comment(lib, "Irrlicht_static.lib") #pragma comment(lib, "IrrlichtExtensions_x64.lib") #endif
Code: Select all
#include "Sailors.h" #include "cSailors.h" int main() { int result = 0; cSailors sailors; if( ( result = sailors.Initialise() ) ) return result; if( ( result = sailors.HaveFun() ) ) return result; return 0; }