Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Glooper on October 07, 2010, 01:10:08 pm
-
Hi All,
I'm using Codeblocks Portable 8.02 on an external hard drive with the MinGW portable installed also. I can compile a DirectX sample program with no problems. What I'd like to do is use the DarkGDK library but I'm getting lots of linker errors "undefined reference to" even though I have carefully included all the required library files in the 'Projects->Build Options...->Linker Settings->Link libraries'
Has anyone succesfully used DarkGDK like this with the GNU GCC Compiler and if so can they tell me how to set up the environment to do it?
Thanks.
-
Are the search directories set up correctly ?
-
Wow! Thanks for a super-fast reply! :D
I think the search directories are set up OK because there is no indication from the linker that the libraries cannot be found. Also, I've actually specified the link libraries by using the full path so they should be found OK.
-
Read this if you've not read it before: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Also:
1. the order is important for the gnu linker (not sure if it is for mingw, though), try shuffling libs
2. not sure if the -l option support paths, most of the time only the lib name is used with this option.
p.s. when you fix your problem please post the solution, so I can improve the FAQ if it is needed :)
-
Thanks,
I have read that document. The lib order should be OK because it is the same order that I use in Visual Studio and it links OK. I was wondering if there was any sort of name-mangling going on in the C++ compiler. If I change the extension of the main file from .cpp to .c I get a different set of errors. (Could be on completely the wrong track here through). Do I need to set any particular flags for MinGW to force 'C' compiling regardless of file extension?
-
If this thread (http://forum.thegamecreators.com/?m=forum_view&t=171737&b=22) is correct, you can not use DarkGDK with MinGW.
-
Thanks for that link Jens - it does look like I'm going to have to forget about DarkGDK if I want to use the GNU compiler.
I guess I'll just have to do it the hard way - D3D native which works just fine with GNU CC (unless I can figure out a way to run the VC compiler from a portable device)