cannot find -ld3dx9.lib
Desmond Taylor

I am trying to link staticly and it comes up with an error saying it cannot find -ld3dx9.lib.

What am I doing wrong?

Arthur Kalliokoski

The -l prefix implies gcc, and the .lib extension implies MSVC. If gcc, try -ld3dx9, for MSVC try d3dx9.lib.

Desmond Taylor

This is my current list.

{"name":"604076","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/0\/b0cf7e99d774791b91e85d81b1102a72.png","w":741,"h":525,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/0\/b0cf7e99d774791b91e85d81b1102a72"}604076

I just tried it without .lib at the end and it still failed.

Arthur Kalliokoski

I thought gcc used *.a files, so you'd want to find libd3dx9.a, not d3dx9.lib.

Desmond Taylor
#SelectExpand
1ld.exe||cannot find -ld3dx9.a| 2||=== Build finished: 1 errors, 0 warnings ===|

Arthur Kalliokoski

You don't add the .a when linking.

Desmond Taylor

When I don't include anything but "d3dx9" I still get an error :/

Nevermind, I found the problem. I forgot to install DirectX SDK xD

Edgar Reynaldo

You're using GCC as your compiler in code::blocks, not MSVC, so you should be linking against *.a files, not *.lib files. Did you download the wrong binary package for Allegro 5? Look in mingw/lib and allegro/lib for the correct archive files. Also, you want the allegro libraries to be linked before addons and before the extra libraries :

Link Libraries :
-----------------
allegro*.a
allegro_addons*.a
extra_libs*.a

Desmond Taylor

No i have the correct one but the MingW distro didnt have the directx 9 libs so I just downloaded the SDK. Still not working but yea, I know not to link against .lib I don't know what I was doing when I even did that xD.

Anyway's, I am going to uninstall Code::Blocks and install mingw from the distro the code::blocks so that I get the files.

Thread #607209. Printed from Allegro.cc