GCC Usage quirks

This is more of a note to myself, as it’s an error I keep bumping into. When compiling manually using gcc (or g++) you should pass all the libraries you’re compiling against at the end of the argument list. E.g.:

g++ -Wall -lboost_thread my_file.cpp

will result in error like:

undefined reference to `boost::thread::join()'
undefined reference to `boost::thread::~thread()'


g++ -Wall vortex5_brute.cpp -lboost_thread

works fine.

One thought on “GCC Usage quirks”

  1. It is order of symbol resolution symbols in vortex5_brute.cpp are resolved in further libraries not the other way around. There is a meaning of linking order it is not “set” is is more like a directional “graph”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.