I'm currently coding a project that uses TitanEngine, but because of portability issues I want to link everything statically...
The problem is that the guide provided here doesn't really work
At first I tried compiling the original DLL version, to test if the code was correct. It wasn't (1>.\TitanEngine.rc(10) : fatal error RC1015: cannot open include file 'afxres.h'.) and I "fixed" it by replacing "afxres.h" by "windows.h"...
After that another error popped up because the author forgot to do: "#define IDC_STATIC -1". I defined it and the DLL compiles (and runs) without errors...
Then I changed the output type to .lib (Static Library), compiled without errors and changed my project settings to link the static library.
But now: when I hit compile on my original project (MingW C++ and CodeBlocks) I get all kinds of "missing references":
||=== ArmaCertTool, Release ===| ||Warning: .drectve `/DEFAULTLIB:"aplib.lib" /DEFAULTLIB:"libcpmt" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" /EXPORT:_ConvertVAtoFileOffsetEx@24 /EXPORT:_TranslateNativeName@4 /EXPORT:_DumpProcess@16 /EXPORT:_DumpProcessW@16 /EXPORT:_DumpProcessEx@16 /EXPORT:_DumpProcessExW@16 /EXPORT:_DumpMemory@16 /EXPORT:_DumpMemoryW@16 /EXPORT:_DumpMemoryEx@16 /EXPORT:_DumpMemoryExW@16 /EXPORT:_DumpRegions@12 /EXPORT:_DumpRegionsW@12 /EXPORT:_DumpRegionsEx@12 /EXPORT:_DumpRegionsExW@12 /EXPORT:_DumpModule@12 /EXPORT:_D| ||Warning: .drectve `/DEFAULTLIB:"aplib.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleInformation@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetProcessImageFileNameA@12'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `@__security_check_cookie@4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_except_handler4'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `_chkstk'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `__security_cookie'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `EnumProcessModules@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleBaseNameA@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleFileNameExA@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleFileNameExA@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleBaseNameA@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleInformation@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleBaseNameA@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleInformation@16'| sdk\TitanEngine.lib(.\Release\TitanEngine.obj)|| undefined reference to `GetModuleBaseNameA@16'| ||More errors follow but not being shown.| ||Edit the max errors limit in compiler options...| ||=== Build finished: 50 errors, 2 warnings (0 minutes, 11 seconds) ===|
I was able to fix the psapi.dll references by adding "psapi.lib" to the static library. the __security_cookie references could be fixed by adding "BufferOverflowU.lib" (from the WinDDK) to the project, but how to fix _chkstk and _except_handler4 references I googled a long time for this but I can't see in which library those functions are :s
I hope some1 here knows what to do (maybe I specified wrong arguments while compiling the static library)
Greetings,
Mr. eXoDia
PS I attached "BufferOverflowU.lib" for the ones who want to test and don't like dloading 650mb
BufferOverflowU.rar 12.39K
9 downloads
Edited by Mr. eXoDia, 22 October 2011 - 01:34 PM.

















