User forums > Help

Cannot find -ldxerr when linking

(1/3) > >>

TwoD:
I followed this guide: http://wiki.codeblocks.org/index.php?title=Code::Blocks_and_Cross_Compilers to set up CB with MinGW to compile some of my Windows projects from Linux. I'm in Ubuntu 8.04 and running the 8.02 release of CB (just upgraded from an old svn nightly installed via someone's .deb package). MinGw is version 4.2.1.dfsg-1ubuntu1.

I had to change the path on the Toolchain tab to just /usr to get it to not complain about invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!].

I managed to get a small console game I made in Visual Studio compile, link and run without much fuss. I even managed to compile, link and run the Ogre examples, despite a few problems regarding strings and DLL-boundries.
But when I tried with another of my projects using D3D9 and D3DX9 (the d3d & d3dx libraries and headers were included with the project to make sure we all used the same versions when the project was in development) I get this error when linking starts:

--- Quote ---Linking console executable: test/SeondEncounter_Debug.exe
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: cannot find -ldxerr
collect2: ld returned 1 exit status

--- End quote ---

I have searched for -ldxerr everywhere but I can't find anything related to it. I noticed the path to ld looks a bit weird, I thought it would use /usr/i586-mingw32msvc/bin/ld but I'm not sure how all this works as I'm not used to Linux development.

If this question is better asked somewhere else, please redirect me there as I have no clue where to start. Thanks!

Jenna:
You can also have a look int this wiki-article.

I wrote it to setup C::B for cross-compiling wxWidgets-apps from linux, but the setup works also for console apps and the standard C::B wizard project.

You only have to chose the cross-compiler and fix the properties for the build target as written here.

TwoD:
Thanks for the quick reply.

I read through the text but found nothing different from my current setup (except of course the WxWidget specific settings).

What puzzles me is that both compiler and linker runs fine on some projects, but not on others.

Do you know what -ldxerr is? I'm guessing something related to the linker and errors but then I'm lost.

stahta01:

--- Quote from: TwoD on May 17, 2008, 07:24:43 pm ---Do you know what -ldxerr is? I'm guessing something related to the linker and errors but then I'm lost.

--- End quote ---

Google results says DirectX error reporting library.

This link might help porting stuff, I am guessing an problem in MinGW based GCC 4.2.1 you are using.

http://www.devdaily.com/scw/c/cygwin/src/winsup/w32api/lib/directx/dxerr.c.shtml

Tim S

TwoD:
Just to be sure I didn't mess up some project setting (I've been tinkering with this project for a while), I made a completely new project in CB and added all the files from the old project. I also added the include/lib paths to fmod and D3D & D3DX libs (the project used to be compiled against the August 2006 release and that's what I'm trying to make it do again, before switching to the latest version.).

This time around it worked a bit better. Compile worked fine and linking actually does something, but it can't find some stuff from DxErr.h (also tried dxerr9.h and the corresponding .lib):

--- Quote ---Linking console executable: bin/Test.exe
collect2: ld terminated with signal 11 [Segmenteringsfel] (segfault in Swedish)
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
/home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006/DxErr.lib(obj/i386/dxerr.obj): In function `_DXTraceW@20':
d:\bt\256\private\:32766: undefined reference to `__chkstk'
d:\bt\256\private\:(.text[_DXTraceW@20]+0x10): undefined reference to `___security_cookie'
d:\bt\256\private\:46: undefined reference to `@__security_check_cookie@4'
/home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006/DxErr.lib(obj/i386/dxerr.obj): In function `_DXTraceA@20':
d:\bt\256\private\:32766: undefined reference to `__chkstk'
d:\bt\256\private\:(.text[_DXTraceA@20]+0x10): undefined reference to `___security_cookie'
d:\bt\256\private\:46: undefined reference to `@__security_check_cookie@4'

--- End quote ---

I've looked around for solutions to this and found some sources, like the Ogre forum, mentioning adding the /GS flag as a fix. But that only works in MSVC...
http://www.ogre3d.org/phpBB2/viewtopic.php?p=251086&sid=ce193664e1d3d7c4af509e6f4e2718c6
Also tried removing the reference to the dxerr libfile, which worked for someone there, but that just lead to an undefined reference to DXGetErrorDescription as expected (called from the resource manager, I can live without it but it'd be great to know why it fails.)

I know that reference errors are a bit off topic and in no way related to CB so I don't expect much help with that here, but it would of course be greatly appreciated.

EDIT: Just an update on my progress: I got rid of the undefined references by not using DXGetErrorDescription, and thereby not using the DxErr header/lib. But I still get the segfault on ld, so I ran it with -v to maybe give someone a clue to what's going on.

--- Quote ---Linking console executable: bin/Test.exe
Using built-in specs.
Target: i586-mingw32msvc
Configured with: /build/buildd/mingw32-4.2.1.dfsg/build_dir/src/gcc-4.2.1-2-dfsg/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --enable-sjlj-exceptions --disable-multilib --enable-version-specific-runtime-libs
Thread model: win32
gcc version 4.2.1-sjlj (mingw32-2)
 /usr/libexec/gcc/i586-mingw32msvc/4.2.1-sjlj/collect2 -Bdynamic -o bin/Test.exe /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/crt2.o /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/crtbegin.o -L/home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006 -L/home/henrik/Projects/SOFE/SecondEncounter/lib/fmod -L/usr/i586-mingw32msvc/lib -L/media/Storage/API/OgreSDK/lib -L/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj -L/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj -L/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib obj/Test/src/BoundingBox.o obj/Test/src/Camera.o obj/Test/src/Engine.o obj/Test/src/Font.o obj/Test/src/InputManager.o obj/Test/src/Listener.o obj/Test/src/Math.o obj/Test/src/MatrixUtils.o obj/Test/src/Mesh.o obj/Test/src/MovableObject.o obj/Test/src/Node.o obj/Test/src/ParticleSystem.o obj/Test/src/Planet.o obj/Test/src/PowerUp.o obj/Test/src/Projectile.o obj/Test/src/Quad.o obj/Test/src/RenderQueue.o obj/Test/src/Renderer.o obj/Test/src/ResourceManager.o obj/Test/src/SOUND.o obj/Test/src/SceneManager.o obj/Test/src/SceneNode.o obj/Test/src/Shader.o obj/Test/src/SpriteObject.o obj/Test/src/StandardWindow.o obj/Test/src/Texture.o obj/Test/src/enemy.o obj/Test/src/entity.o obj/Test/src/main.o obj/Test/src/player.o obj/Test/src/timer.o obj/Test/src/weapon.o -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lodbc32 -lwsock32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid /home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006/dinput8.lib /home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006/d3dx9d.lib /home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006/d3d9.lib /home/henrik/Projects/SOFE/SecondEncounter/lib/fmod/fmodvc.lib /home/henrik/Projects/SOFE/SecondEncounter/lib/dxSdkAugust2006/dxguid.lib -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/crtend.o
collect2: ld terminated with signal 11 [Segmenteringsfel]
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
Process terminated with status 1 (0 minutes, 4 seconds)
0 errors, 8 warnings

--- End quote ---
The warnings are mostly "warning: ignoring #pragma warning ", there are usually a lot more but this was a partial recompile/link after me removing the DxGetError... call.

Navigation

[0] Message Index

[#] Next page

Go to full version