User forums > Using Code::Blocks
DirextX and Code::Blocks
Dark_Phoenix:
Hello...
I just now started using Code::Blocks, and so far I like it, but I am having problems compiling DirectX applications. Here is my build log
--- Code: ---d3dx9.lib(cpudetect.obj):: error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function "int __stdcall GetD3DRegValue(unsigned long,char *,void *,unsigned long)" (?GetD3DRegValue@@YGHKPADPAXK@Z)
d3dx9.lib(d3dx9dbg.obj):: error LNK2001: unresolved external symbol __imp__RegCloseKey@4
d3dx9.lib(cpudetect.obj):: error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function "int __stdcall GetD3DRegValue(unsigned long,char *,void *,unsigned long)" (?GetD3DRegValue@@YGHKPADPAXK@Z)
d3dx9.lib(d3dx9dbg.obj):: error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function "int __stdcall GetD3DRegValue(unsigned long,char *,void *,unsigned long)" (?GetD3DRegValue@@YGHKPADPAXK@Z)
d3dx9.lib(cpudetect.obj):: error LNK2019: unresolved external symbol __imp__RegOpenKeyA@12 referenced in function "int __stdcall GetD3DRegValue(unsigned long,char *,void *,unsigned long)" (?GetD3DRegValue@@YGHKPADPAXK@Z)
d3dx9.lib(d3dx9dbg.obj):: error LNK2001: unresolved external symbol __imp__RegOpenKeyA@12
bin\Debug\DirectInputCB.exe:: fatal error LNK1120: 3 unresolved externals
:: === Build finished: 7 errors, 0 warnings ===
--- End code ---
I currently have the 061007 build of C::B, and am using the MS VC toolkit 2003. I have the search directories set up for MSVC toolkit, the platform SDK and the DX SDK, and I have all the libraries listed in my linker options - d3d9, d3dx9, dxguid, dinput8, user32, winmm, and gdi32.
Not sure what I am missing here. I am guessing that there is a library that I need that is not linking but I am not sure. This has left me a bit confused as I have compiled this exact app with the same linker options successfully in dev-c++.
Any ideas?
MortenMacFly:
--- Quote from: Dark_Phoenix on June 16, 2007, 04:34:54 pm ---This has left me a bit confused as I have compiled this exact app with the same linker options successfully in dev-c++.
--- End quote ---
You need to link against advapi32. Make sure this lib is added in the project's linker settings.
(BTW: I would swear the DevCpp has that option - otherwise linking would fail there, too.)
With regards, Morten.
Ps.: BTW: You can consult the MSDN easily for Win32API to find out which libs you need to link against.
Dark_Phoenix:
OK, I am still at a loss here. I have the advapi32 lib listed in the linker settings and the dll is in my system directory. The lib file is actually in both the c::b/lib and the MSPlatformSDK/lib directories, could there be a conflict here since I have both of those set up in my search directories?
MortenMacFly:
--- Quote from: Dark_Phoenix on June 17, 2007, 03:26:15 pm ---could there be a conflict here since I have both of those set up in my search directories?
--- End quote ---
Sure. You shouldn't do that. At some point you have to decide what compiler you choose: MinGW or a MS one. For the MinGW you need to use the MinGW Win32API files and libs (provided at Mingw.org), for MS compiler you better use the platform SDK. There is (however) a way to combine both worlds but why do so? You have the core (API) libs of WinAPI for both - so it's better you stay consistent. There is (BTW) also a Direct/X DevPak especially for MinGW... google for it. If you want to stick with VS2003 - kick out the MinGW "addons".
With regards, Morten.
Dark_Phoenix:
--- Quote ---If you want to stick with VS2003 - kick out the MinGW "addons".
--- End quote ---
VS2003 is what I want to use here. I have always used minGW with dev-c++ and the DX devpak but that is kind of a pain so I am looking into c::b to do my DX programming. Those files and directories were set up automatically by c::b and the platform sdk. So if I want to stick with VS2003 which lib should I use, the one in the platform sdk/lib directory or the one from c::b?
btw, if it matters.... I have c::b set up to use the VC2003 compiler
Navigation
[0] Message Index
[#] Next page
Go to full version