Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Using DirectX with Code::Blocks

<< < (2/4) > >>

MortenMacFly:

--- Quote from: stahta01 on January 26, 2011, 02:07:16 pm ---
--- Quote from: MortenMacFly on January 26, 2011, 07:51:17 am ---There is no need for any conversion. MinGW can handle the windows library files (*.lib) just fine!

--- End quote ---
When did this happen?

--- End quote ---
I don't know, but I am doing this a lot at work. All direct/x related apps are linked against the MS SDK without issues.

I wasn't aware that this was not possible earlier... :shock: Probably the functions I am using are MinGW friendly in the first place... (well I did modify some of the header myself though...)

stahta01:

--- Quote from: antonien on January 25, 2011, 09:20:25 pm ---Hi everybody

Is there a difference of behaviour between a program compiled with MinGW and the same program compiled with another compiler ?


--- End quote ---

Yes, if the programmer is not doing his/her job right; And sometimes yes, if the program is using complex library that has different support between compilers.

antonien:
I am progressing slowly. I used the DirectX wizard, I replaced <strsafe.h> by <cstddef> as advised somewhere else, I removed the "L" before any string to make it compile... and linking failed :

mingw32-g++.exe -LC:\CodeBlocks\DirectX\lib  -o bin\Debug\Directxtest.exe obj\Debug\main.o    -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -ld3d9 -ld3dx9 C:\CodeBlocks\DirectX\Lib\x64\d3dx9.lib
c:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -ld3dx9
What's that ?
d3dx9.lib is sitting in the lib directory and this directory is made available to the linker.

Any idea of what happens ?

Thanks in advance.

ironhead:
I am going to assume this was all one line (i.e. the d3dx9.lib reference was at the end of the line):


--- Quote from: antonien on January 26, 2011, 09:50:24 pm ---mingw32-g++.exe -LC:\CodeBlocks\DirectX\lib  -o bin\Debug\Directxtest.exe obj\Debug\main.o    -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -ld3d9 -ld3dx9 C:\CodeBlocks\DirectX\Lib\x64\d3dx9.lib
--- End quote ---

The '-ld3dx9' isn't required if you are passing in d3dx9.lib, in fact it's causing this error:


--- Quote from: antonien on January 26, 2011, 09:50:24 pm ---c:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -ld3dx9
--- End quote ---

Because MinGW is looking for libd3dx9.a.  You can drop -LC:\CodeBlocks\DirectX\lib if you are passing in the absolute path of the library.

antonien:
Thanks for the answer : I did remove d3dx9 from the linker settings (actually, I didn't know it was there : it's the wizard who did that for me).

Next stop : winmain@16

Undefined reference to WinMain@16 !
Couldn't find any reference to that WinMain@16...

I am getting fed up with MinGW...

If anybody has a cue, I'll be gratefull.

Best regards

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version