Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SEMI-SOLVED]Linking problem with QT Creator on Mac OS X (boost regex)
Forum Updated to NodeBB v4.3 + New Features

[SEMI-SOLVED]Linking problem with QT Creator on Mac OS X (boost regex)

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zeller
    wrote on last edited by
    #1

    Hello

    I've added boost_regex.a to my project in qt creator (using the add library... context menu command) but when I run the app it crashes failing to load it and complaining about the dylib instead.
    Here is the relevant part of the generated .pro file:

    INCLUDEPATH += /boost/148/include

    macx: LIBS += -L$$PWD/../../../../../boost/148/lib/ -lboost_regex

    INCLUDEPATH += $$PWD/../../../../../boost/148/include
    DEPENDPATH += $$PWD/../../../../../boost/148/include

    macx: PRE_TARGETDEPS += $$PWD/../../../../../boost/148/lib/libboost_regex.a

    I recall that on osx you don't specify the libs using the -l flag but simply adding them as arguments to the compiler, but qt generates a makefile where this rule is not followed:

    LIBS = $(SUBLIBS) -F/cpplibsQtSDK/Desktop/Qt/4.8.1/gcc/lib -L/cpplibsQtSDK/Desktop/Qt/4.8.1/gcc/lib -L/Users/davidborsodi/Documents/workspace_cpp/sc_leveleditor/../../../../../boost/148/lib/ -lboost_regex -framework QtOpenGL -L/usr/local/pgsql/lib -L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -framework QtGui -framework QtCore -framework OpenGL -framework AGL

    How should I modify the pro file to get qt correctly link the libs?

    thanks
    david

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zeller
      wrote on last edited by
      #2

      I've found one solution for dynamic linking combining the instructions of these two so posts:
      http://stackoverflow.com/questions/3729810/boost-regex-not-playing-welll-with-snow-leopard
      http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x
      though I haven't tried it for static but I'm content with this for now...

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved