User forums > Using Code::Blocks
Alright...DirectX again...
All0i5hu5:
I am still trying to get the DirectX Simple Sample project to compile:
My environment: Windows XP SP 2, Codeblocks RC2, C++ Toolkit 2003, Platform SDK, DirectX 9.0 SDK October, and .NET Framework SDK. All SDKs installed to default locations.
I was able to walk the project through the libraries and files, but am stumped as to what is causing the problem now. I created the project from new as a Win32 GUI application and then added the files: Simplesample.cpp, .fx, .rc, .jpg, and resource.h
I checked the project using Visual Studio .NET and the project compiles fine there.
**********************************BUILD LOG**************************************************************
Project : Sample
Compiler : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Documents and Settings\Aardvarkius\My Documents\Projects\ASample\
--------------------------------------------------------------------------------
Switching to target: default
RC.Exe /I"C:\Program Files\Microsoft Platform SDK\Bin" /I"C:\Program Files\Microsoft Platform SDK\Include" -fo.objs\SimpleSample.res SimpleSample.rc
cl.exe /nologo /DUNICODE /I"C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Samples\C++\Common" /I"C:\Program Files\Microsoft Platform SDK\Include" /I"C:\Program Files\Microsoft Platform SDK\Include\crt" /I"C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Include" /c SimpleSample.cpp /Fo.objs\SimpleSample.obj
SimpleSample.cpp
link.exe /nologo /subsystem:windows /LIBPATH:"C:\Program Files\Microsoft Platform SDK\Lib" /LIBPATH:"C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib" /LIBPATH:"C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Lib\x86" /out:Sample.exe gdi32.lib user32.lib kernel32.lib .objs\SimpleSample.obj .objs\SimpleSample.res
SimpleSample.obj : error LNK2019: unresolved external symbol "int __cdecl DXUTGetExitCode(void)" (?DXUTGetExitCode@@YAHXZ) referenced in function _WinMain@16
SimpleSample.obj : error LNK2019: unresolved external symbol "long __cdecl DXUTMainLoop(struct HACCEL__ *)" (?DXUTMainLoop@@YAJPAUHACCEL__@@@Z) referenced in function _WinMain@16
A whole bunch of other library linker errors
OnDestroyDevice@CD3DSettingsDlg@@QAEJXZ) referenced in function "void __stdcall OnDestroyDevice(void *)" (?OnDestroyDevice@@YGXPAX@Z)
Process terminated with status 1 (0 minutes, 9 seconds)
52 errors, 0 warnings
*****************************************************************************************************
I guess it is a library causing the problem. But where?
My Codeblocks Setup is:
Settings -> Compiler -> Compiler Tab -> #defines Tab:
UNICODE
Settings -> Compiler -> Directories Tab -> Compiler Tab:
C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Samples\C++\Common
C:\Program Files\Microsoft Platform SDK\Include
C:\Program Files\Microsoft Platform SDK\Include\crt
C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Include
Settings -> Compiler -> Directories Tab -> Linker Tab:
C:\Program Files\Microsoft Platform SDK\Lib
C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib
C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Lib\x86
Settings -> Compiler -> Directories Tab -> Resource Compiler Tab:
C:\Program Files\Microsoft Platform SDK\Bin
C:\Program Files\Microsoft Platform SDK\Include
Settings -> Compiler -> Programs Tab -> Additional Paths Tab:
C:\Program Files\Microsoft Platform SDK\Bin
Any ideas? I have played around with using various libraries (the .NET library for instance), but apparently I am doing that wrong, or am still using the wrong libraries.
Michael:
Hello,
I do not know if this can help, but I also have:
Settings -> Compiler -> Directories Tab -> Compiler Tab:
C:\Programme\Microsoft Visual C++ Toolkit 2003\include
Settings -> Compiler -> Directories Tab -> Resource Compiler Tab:
C:\Programme\Microsoft Visual C++ Toolkit 2003\bin
You can also check if your Microsoft Platform SDK is up to date.
If the project compiles fine in Visual Studio .NET (2003 I assume), then have a look at which kind of directories and project parameters are set and do the same with C::B.
Best wishes,
Michael
All0i5hu5:
I have added both of those to no avail. Adding them or not adding them gives me 52 fatal errors of the type above. So there is no change.
My dxut.h file appears not to be pulling functions from the correct library. I haven't changed that, however. And this is a simple stock sample from DirectX SDK.
This is the latest DirectX SDK. I have all of the latest SDKs available, in fact, as I have installed them all from the web.
I checked VS 2003....there are a few differences, but only because VS 2003 has prerelease bins and includes that do not come with the standalone SDKs. Also, C++ Toolkit does not have debug support, as VS does. Other than that...everything pretty much looks the same. I am not sure where I went wrong, but I did somewhere.
Deleting the project and redoing it from scratch does not seem to help, either. I am at a loss now.
Vampyre_Dark:
Are you adding the libraries to the build options?
dxguid
d3d
dinput.lib
All that crap, whatever the files are called. :D
That's what your errors indicate.
Michael:
Hello,
Question to Vampire_Dark: Do you not have to add the extension .lib to the dxguid and d3d libraries (as you did for the dinput.lib)?
I have also tried myself 1-2 days ago with samples of DirectX (October 2005), but I have had problems with PCH, unicode, and several link errors. I have opened the project using VS C++ .NET 2003 and copied the required libraries in C::B (and looked at other project options too). Anyway, no success. I have also tried to add other libraries, but no results.
Anyway, did you tried to compile the DXUT project? I have tried, but with my samples it did not work :(.
To be honest MS Toolkit .NET 2003 give me much troubles than VS C++ .NET 2003 (may be some of my problems are a consequence of the fact that the MS Toolkit .NET 2003 does not come with debugging libraries). May be I have to try to use C::B with the compile/linker that come with VS C++ .NET 2005 Express Edition :).
Best wishes,
Michael
Navigation
[0] Message Index
[#] Next page
Go to full version