Guy Rutenberg

Keeping track of what I do

GCC Usage quirks

with one comment

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()'

while

g++ -Wall vortex5_brute.cpp -lboost_thread

works fine.

Share and Enjoy:
  • del.icio.us
  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google Bookmarks
  • Simpy

Written by Guy

November 27th, 2011 at 12:50 am

Posted in Tips

Tagged with

One Response to 'GCC Usage quirks'

Subscribe to comments with RSS or TrackBack to '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”

    artyom

    28 Nov 11 at 15:22

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">