User forums > Help

Problems with DX9.0c and MingW

<< < (2/3) > >>

Ceniza:
Could you please tell us the svn revision number you are using?

When you say it's still compiling in Debug mode, does it mean that even when you select Release in the toolbar it still says "Compiling Debug"? If so, be sure you're really using the latest available Nightly build.

Now, about the addition of libraries, have in mind that if you have 2 targets you have 3 places where you can add those liker libraries: project global, target 1 (Release) and target 2 (Debug). Maybe you've been checking only those for one of the targets.

patlecat:
Hi Ceniza :)

I'm using CB v3988 and yes I am selecting "Release" in the toolbar.
**Added** I updated to 3989 and now it seems that I can compile as Release. But what happened in between?


--- Quote ---Now, about the addition of libraries, have in mind that if you have 2 targets you have 3 places where you can add those linker libraries: project global, target 1 (Release) and target 2 (Debug). Maybe you've been checking only those for one of the targets.
--- End quote ---
I'm sorry but I don't understand what you mean here. Where would target1 and target2 be? You can see from my .cbp file what I added. And I only added stuff to the Release target not Debug.

patlecat:
Ok with CB 3989 I still have problems, but with linking this time.

Now it say that it can't find d3d9.lib even though the paths must be right. But I find it strange, that CB looks for libs in a directory that doesn't exist: X:DX90SDK\lib\x86 I only have X:DX90SDK\lib


--- Code: ----------------- Build: Release in dxTest2 ---------------
mingw32-g++.exe -Wall -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -O2 -D_UNICODE -IE:\DX90SDK\include -Ih:\MinGW\include -c H:\myProjects2\dxTest2\main.cpp -o obj\Release\main.o
In file included from E:/DX90SDK/include/d3d9.h:211,
from H:\myProjects2\dxTest2\main.cpp:4:
E:/DX90SDK/include/d3d9types.h:25: warning: ignoring #pragma warning
E:/DX90SDK/include/d3d9types.h:1850: warning: ignoring #pragma warning
In file included from E:/DX90SDK/include/d3dx9.h:47,
from H:\myProjects2\dxTest2\main.cpp:5:
E:/DX90SDK/include/d3dx9math.h:19: warning: ignoring #pragma warning
In file included from E:/DX90SDK/include/d3dx9.h:47,
from H:\myProjects2\dxTest2\main.cpp:5:
E:/DX90SDK/include/d3dx9math.h:1761: warning: ignoring #pragma warning
In file included from E:/DX90SDK/include/d3dx9.h:48,
from H:\myProjects2\dxTest2\main.cpp:5:
E:/DX90SDK/include/d3dx9core.h:644:1: warning: multi-line comment
H:\myProjects2\dxTest2\main.cpp:16: warning: ignoring #pragma comment
H:\myProjects2\dxTest2\main.cpp:17: warning: ignoring #pragma comment
In file included from E:/DX90SDK/include/d3dx9math.h:1756,
from E:/DX90SDK/include/d3dx9.h:47,
from H:\myProjects2\dxTest2\main.cpp:5:
E:/DX90SDK/include/d3dx9math.inl: In constructor 'D3DXVECTOR2_16F::D3DXVECTOR2_16F(const D3DXFLOAT16*)':
...
E:/DX90SDK/include/d3dx9math.inl:737: warning: dereferencing type-punned pointer will break strict-aliasing rules
H:\myProjects2\dxTest2\main.cpp: In function 'void render_frame()':
H:\myProjects2\dxTest2\main.cpp:170: warning: taking address of temporary
H:\myProjects2\dxTest2\main.cpp:171: warning: taking address of temporary
H:\myProjects2\dxTest2\main.cpp:172: warning: taking address of temporary
mingw32-g++.exe -LE:\DX90SDK\lib\x86 -Lh:\MinGW\lib -o bin\Release\dxTest2.exe obj\Release\main.o -s -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -ld3d9 -ld3dx9 -mwindows
h:/mingw/bin/../lib/gcc/mingw32/4.2.0/../../../../mingw32/bin/ld.exe: cannot find -ld3dx9
collect2: ld returned 1 exit status
--- End code ---

The actual project file:

--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="dxTest2" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\dxTest2.exe" prefix_auto="1" extension_auto="1" />
<Option working_dir="bin\Debug\" />
<Option object_output="obj\Debug\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin\Release\dxTest2.exe" prefix_auto="1" extension_auto="1" />
<Option working_dir="bin\Release\" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add directory="${#dx}\include" />
</Compiler>
<Linker>
<Add library="kernel32" />
<Add library="user32" />
<Add library="gdi32" />
<Add library="winspool" />
<Add library="comdlg32" />
<Add library="advapi32" />
<Add library="shell32" />
<Add library="ole32" />
<Add library="oleaut32" />
<Add library="uuid" />
<Add library="odbc32" />
<Add library="odbccp32" />
<Add library="d3d9" />
<Add library="d3dx9" />
<Add directory="${#dx}\lib\x86" />
<Add directory="${#dx}\lib" />
</Linker>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
</Extensions>
</Project>
</CodeBlocks_project_file>
--- End code ---

Building the Debug works fine, I get an .exe which runs fine. Strange...

patlecat:
I'm getting crazy with CB. I restarted CB a few minutes later and suddenly Debug compiles fine and produces a nice .exe. Then I try to build Release but it has the above problem again. Then I restart CB and change some options and suddenly Debug doesnt build anymore. :shock:

Ceniza:
The fact that you selected a target in the toolbar and it still tried to compile the other one was a bug introduced in that version and fixed in the next one, that's why I asked.

Maybe I'm not using the best words to describe the options, so I'll put this image:



If you click on the different "options" at the right thingy (tree) you can see how the Linker settings will change. Same for Compiler settings, Search directories, etc. Be sure you have checked the options for all of them and that everything is right.

Have in mind the "Project global" applies to all targets.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version