Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » cannot find -ld3dx9.lib

This thread is locked; no one can reply to it. rss feed Print
cannot find -ld3dx9.lib
Desmond Taylor
Member #11,943
May 2010
avatar

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
Second in Command
February 2005
avatar

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

They all watch too much MSNBC... they get ideas.

Desmond Taylor
Member #11,943
May 2010
avatar

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
Second in Command
February 2005
avatar

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

They all watch too much MSNBC... they get ideas.

Desmond Taylor
Member #11,943
May 2010
avatar

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

Arthur Kalliokoski
Second in Command
February 2005
avatar

You don't add the .a when linking.

They all watch too much MSNBC... they get ideas.

Desmond Taylor
Member #11,943
May 2010
avatar

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
Major Reynaldo
May 2007
avatar

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
Member #11,943
May 2010
avatar

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.

Go to: