User forums > Using Code::Blocks

Linking to Libraries

(1/4) > >>

racer319:
Windows XP, Code::Blocks 10.05

I'm using SDL and it's working fine, but now i'm trying to implement the SDL_gfx library. I downloaded it, extracted it, and put all the header/cpp files into a shared library project in CB and built it. In the release folder there were three files: libSDL_gfx.dll, libSDL_gfx.dll (A File), and libSDL_gfx.dll (Export Definition File).

I put the first into the SDL bin folder, next to SDL.dll. the second in the SDL lib folder next to libSDLmain and libSDL.dll. the third one i didn't do anything with. I then took all the header files that came with the download and put them in my SDL include folder.

When I compile, it works, but when I try to use a function from the library (pixelRGBA) i get the error: undefinded reference to 'pixelRGBA'

I'm quite sure I did something horribly stupid. Could someone tell me where I went wrong? Thanks.

oBFusCATed:
Read this please: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F

racer319:
I've done that.

Link libraries:
SDL_gfx.dll

Search Directories -> Linker:

C:/SDL/lib

Did I build the library wrong?

oBFusCATed:
Remove .dll in SDL_gfx and try again.

Also check with a tool capable of reading dlls if the missing symbols are in your library.
One such tool is dependency walker.

stahta01:
I strongly suggest turning on full compiler logging
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Note: With some linker options the order of options matter.

Tim S.

Navigation

[0] Message Index

[#] Next page

Go to full version