On Fri, Oct 22, 2004 at 01:44:44PM -0700, Sara Collins wrote:
This might be very easy for a lot of you but I've been banging my head on the wall.
I just installed the boost library and tried to run a simple test file using boost.thread.mutex
#include
int main() { boost::mutex m; }
I got this compilation error message: undefined reference to `boost::mutex::mutex[in-charge]()'
I guess I have to link in the libboost_thread.dll file
Yes, you do, otherwise the linker can't find the definition of your class that has already been compiled and lives elsewhere. It's fairly simple on a Unix-like system. If you're on that system that uses the .dll naming convention, then I can't help you much. Now to build your program, you need to know the where your library is, and what it is named. On my machine it is in ~/local/lib and is called libboost_thread-gcc-mt.so, so for me to compile your program I would do: $ g++ -L~/local/lib -lboost_thread-gcc-mt program.cpp -o program Notice that when using the `-l' flag, you drop the `lib' prefix and `.so' suffix.
somehow but I don't seem to find a solution how. Perharps I've been searching the wrong places.
This HOWTO has been useful to me. http://www.tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
Please help the newbie. Thanks a lot in advance.
No problem. Justin