You problem is not with compiling but linking. You need to tell g++ where to find also the library. You can configure codeblocks to do that for you. The weird things in front the function name is due to C++ code. C++ compilers put things in front of functions names. See this link for more:http://en.wikipedia.org/wiki/Name_mangling
Take care.
But this seems to imply that g++ can't find the library at all, which it can since lots of other stuff works fine. Suggestions?