c++static-librariescodeblockssdl-2sdl-mixer

Undefined References to SDL_mixer functions from a static library (Code::Blocks)


So, I've made a static library with references to SDL_mixer functions (and those work fine), but when I try to build the project that links to the library, Code::Blocks tells me that every function used (in the static library) is an undefined reference. I've searched and searched, but everyone else seems to always have a linker problem, so here is my order: -lSDL2, -lSDL2_ttf, -lSDL2_mixer, -lGL, -lGLEW, and then my library

Everything works fine, except for the one file that I try to use SDL_mixer functions. And by the way, everything worked before I converted to Code::Blocks. Any help is greatly appreciated :)


Solution

  • It was the order that I was linking the libraries. I changed the order so that my library was linked before the rest, and it worked perfectly

    I guess I shouldn't be so confident with my own code so much :|