2

I would like to use boost/filesystem.hpp in my Qt app but the builder keeps saying:

Library not loaded: libboost_filesystem.dylib
Reason: image not found

here is how I try to link it:

INCLUDEPATH+= /installdir/boost_1_50_0  
LIBS += -L/installdir/boost_1_50_0/stage/lib -lboost_filesystem

I've tried linking directly, too. I've also tried rebuilding boost according to jschoen's answer, no difference.
Im running a MacOSX Lion. How do I have to link boost properly?

Community
  • 1
  • 1
Barney Szabolcs
  • 11,846
  • 12
  • 66
  • 91

1 Answers1

3

In the meantime I have found a solution.

  1. install boost with macports (sudo port install boost) Thanks to dies and Tim Cooper.
  2. then link against:

INCLUDEPATH += /opt/local/include
LIBS += -L/opt/local/lib
LIBS += -lboost_system-mt -lboost_filesystem-mt

Community
  • 1
  • 1
Barney Szabolcs
  • 11,846
  • 12
  • 66
  • 91
  • how do you 'link against' in Qt Creator? This looks like makefile code I need to be modifying somewhere. Is done through the GUI? Can you provide more explicit direction? – tarabyte Jun 15 '14 at 17:57
  • nm, macports seems to have gone irrelevant. searching for other options. – tarabyte Jun 15 '14 at 17:58
  • you are a lifesaver! Been beating my head against insane compile times and missing includes when trying to bring boost into QtCreator. Thanks! – Joel Feb 24 '15 at 02:04