I am using Code Blocks with mingw and am trying to get a simple program to compile with static linking. I have build the boost libraries using these directions, here. Everything worked out fine and i was able to successfully compile this simple program (it compiles, i know it doesn't work because it exits before the message is sent to the console, but i just want it to compile). If i have a DLL in my linker libraries, it compiles fine, but when i switch it with the static .a libraries of the same contents, I get undefined references such as "undefined reference to `imp__ZN5boost6threadD1Ev'|". I have no idea what the problem is and cant find the solution. I think i might have to do with linker settings but i cant find information on how to change them. I would be extremely great full for any help that could be provided.
#include <iostream>
#include <boost/thread.hpp>
void myfunction()
{
std::cout << "this is a thread" << std::endl;
return;
}
int main()
{
boost::thread mythread(&myfunction);
return 0;
}