Linker error in RenderSystem_Direct3D9

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
StarAD
Gnoblar
Posts: 22
Joined: Sat Dec 02, 2006 10:38 am
Location: Barcelona,Spain

Linker error in RenderSystem_Direct3D9

Post by StarAD »

Hi:


I have used ogre precompiled from a few months ago and for one week it has been trying to compile ogre. After many problems, I was able to compile the OgreMain library. Later i try to compile RenderSystem_Direct3D9 and I was with an error in the Link process that I have still not been able to solve.

I use Eclipse and Mingw (i know that you do not give support to eclipse but to see if somebody that has used it has found with the same problem). The version of DirectX SDK that I use is the version of August of 2007.

This is the command used for Link and the error:

Code: Select all

**** Build of configuration Release for project RenderSystem_Direct3D9 ****

mingw32-make -k all 
Building target: RenderSystem_Direct3D9.dll
Invoking: GCC C++ Linker
g++ -L"E:/DirectXSDK/lib/x86" -L../../../OgreMain/Release -L../../../Dependencies/lib -Wl,--enable-runtime-pseudo-reloc -shared -o"RenderSystem_Direct3D9.dll"  ./src/OgreD3D9Driver.o ./src/OgreD3D9DriverList.o ./src/OgreD3D9EngineDll.o ./src/OgreD3D9GpuProgram.o ./src/OgreD3D9GpuProgramManager.o ./src/OgreD3D9HLSLProgram.o ./src/OgreD3D9HLSLProgramFactory.o ./src/OgreD3D9HardwareBufferManager.o ./src/OgreD3D9HardwareIndexBuffer.o ./src/OgreD3D9HardwareOcclusionQuery.o ./src/OgreD3D9HardwarePixelBuffer.o ./src/OgreD3D9HardwareVertexBuffer.o ./src/OgreD3D9Mappings.o ./src/OgreD3D9MultiRenderTarget.o ./src/OgreD3D9Plugin.o ./src/OgreD3D9RenderSystem.o ./src/OgreD3D9RenderWindow.o ./src/OgreD3D9Texture.o ./src/OgreD3D9TextureManager.o ./src/OgreD3D9VertexDeclaration.o ./src/OgreD3D9VideoMode.o ./src/OgreD3D9VideoModeList.o   -lOgreMain -ld3d9 -ld3dx9d -lDxErr9 -ldxguid -lkernel32 -luser32


Info: resolving vtable for Ogre::Exceptionby linking to __imp___ZTVN4Ogre9ExceptionE (auto-import)
Info: resolving Ogre::StringInterface::msDictionary       by linking to __imp___ZN4Ogre15StringInterface12msDictionaryE (auto-import)
Info: resolving vtable for Ogre::GpuProgramby linking to __imp___ZTVN4Ogre10GpuProgramE (auto-import)
Info: resolving vtable for Ogre::MultiRenderTargetby linking to __imp___ZTVN4Ogre17MultiRenderTargetE (auto-import)
Info: resolving Ogre::Frustum::INFINITE_FAR_PLANE_ADJUST      by linking to __imp___ZN4Ogre7Frustum25INFINITE_FAR_PLANE_ADJUSTE (auto-import)
Info: resolving Ogre::Matrix4::ZERO     by linking to __imp___ZN4Ogre7Matrix44ZEROE (auto-import)
Info: resolving Ogre::Matrix4::CLIPSPACE2DTOIMAGESPACE      by linking to __imp___ZN4Ogre7Matrix423CLIPSPACE2DTOIMAGESPACEE (auto-import)
Info: resolving Ogre::Matrix4::IDENTITY     by linking to __imp___ZN4Ogre7Matrix48IDENTITYE (auto-import)
Info: resolving Ogre::StringUtil::BLANK      by linking to __imp___ZN4Ogre10StringUtil5BLANKE (auto-import)
Info: resolving vtable for Ogre::RenderWindowby linking to __imp___ZTVN4Ogre12RenderWindowE (auto-import)
Info: resolving vtable for Ogre::Textureby linking to __imp___ZTVN4Ogre7TextureE (auto-import)
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
./src/OgreD3D9RenderWindow.o:OgreD3D9RenderWindow.cpp:(.text+0x5a88): undefined reference to `GetStockObject@4'
E:/DirectXSDK/lib/x86/DxErr9.lib(obj/i386/dxerr9.obj): In function `DXTraceW@20':
e:\dxsdk\wggt_aug0:32766: undefined reference to `_chkstk'
e:\dxsdk\wggt_aug0:(.text[_DXTraceW@20]+0x10): undefined reference to `__security_cookie'
e:\dxsdk\wggt_aug0:46: undefined reference to `@__security_check_cookie@4'
E:/DirectXSDK/lib/x86/DxErr9.lib(obj/i386/dxerr9.obj): In function `DXTraceA@20':
e:\dxsdk\wggt_aug0:32766: undefined reference to `_chkstk'
e:\dxsdk\wggt_aug0:(.text[_DXTraceA@20]+0x10): undefined reference to `__security_cookie'
e:\dxsdk\wggt_aug0:46: undefined reference to `@__security_check_cookie@4'
collect2: ld returned 1 exit status
mingw32-make: *** [RenderSystem_Direct3D9.dll] Error 1
mingw32-make: Target `all' not remade because of errors.
Build complete for project RenderSystem_Direct3D9
Thx for help.
User avatar
neocryptek
Gnome
Posts: 335
Joined: Sat Mar 01, 2003 11:21 pm
Location: Idaho, USA
Contact:

Post by neocryptek »

Hmm, the security_cookie error has been brought up a few times before, though each time it was related to VC6. Build FAQ states a few ways to fix it you could try: get the "extras" package for your DirectX SDK version, or try the old VC6 compatible SDK, summer 2004.

Googling around for more security_cookie related stuff, I found something you can try, might be related:
Note to people trying to link NumPy against CLAPACK built with Visual Studio 2005 when compiling with MinGW GCC: if you get undefined references to __security_check_cookie and/or __security_cookie, try compiling the library without buffer security checks, i.e. add the /GS- flag.
A MSDN page lists their libraries you can link to to resolve the new security features.

Not sure how those will work out with MinGW, but can't hurt to try.
User avatar
StarAD
Gnoblar
Posts: 22
Joined: Sat Dec 02, 2006 10:38 am
Location: Barcelona,Spain

Post by StarAD »

Hi:

Thx for help. I solved the GetStockObject@4 error linking the gdi32 library but the security cookie I have not been able to solve. I try to add diferents flags ( --subsystem windows, -mwindows), linking new libraries but the problem persists.
Note to people trying to link NumPy against CLAPACK built with Visual Studio 2005 when compiling with MinGW GCC: if you get undefined references to __security_check_cookie and/or __security_cookie, try compiling the library without buffer security checks, i.e. add the /GS- flag.
I read the MingW documentation but in the link not have GS flag, only in MVC.

Somebody knows some solution?

Thx
Igor
Halfling
Posts: 40
Joined: Fri Aug 17, 2007 4:14 am
Location: Omsk

Post by Igor »

Yes, got a same error today!
I'm using MinGW Toolbox and it includes all needed libraries
so, i just deleted a reference to a MS DirectX SDK libs from project settings
(E:/DirectXSDK/lib/x86 in your case) while leaving includes intact (we need d3dx9.h from there)

strrrangely, it works for me...
adcamel
Gnoblar
Posts: 1
Joined: Fri Feb 27, 2009 8:45 am

Re: Linker error in RenderSystem_Direct3D9

Post by adcamel »

I know that this post is a bit old, but today I had the same error that StarAD and the solution of Igor works for me ;)
Yes, it's really strange that with the libraries of DX from MingW this works and with the libraries from the DX SDK don't, but well..., it works.

Thanks Igor! :D
Igor
Halfling
Posts: 40
Joined: Fri Aug 17, 2007 4:14 am
Location: Omsk

Re: Linker error in RenderSystem_Direct3D9

Post by Igor »

U"re welcome.
Good"ole days when i started using Ogre =) Forced me away from procedural programming
Post Reply