Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Boost 1.47 link with QtCreator2.5

Boost 1.47 link with QtCreator2.5

Scheduled Pinned Locked Moved 3rd Party Software
2 Posts 2 Posters 2.6k 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.
  • Q Offline
    Q Offline
    qinsisi
    wrote on last edited by
    #1

    Hi, I have searched all the posts about Boost but still cannot fix my problem...
    I just want to use Boost library only, but suffering on it.

    My Steps:

    1. Install boost : sudo port boost.
      it installed header files and library files into /opt/local/include and /opt/local/lib
    2. create a C++ project in QtCreator2.5
      testing code
      @
      #include <iostream>
      #include <boost/asio.hpp>

    int main ()
    {
    return 0;
    }
    @
    pro file is
    @
    TEMPLATE = app
    CONFIG += console
    CONFIG -= qt

    INCLUDEPATH += /opt/local/include #I add this
    LIBS += -L/opt/local/lib #I add this

    SOURCES += main.cpp
    @

    And then I built, the result is
    @
    make: Entering directory /Users/qinsisi/test/timer' g++ -headerpad_max_install_names -arch i386 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o 01_timer.app/Contents/MacOS/01_timer main.o -L/opt/local/lib ld: warning: ignoring file main.o, file was built for unsupported file format which is not the architecture being linked (i386) Undefined symbols for architecture i386: "_main", referenced from: __start in crt1.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status Undefined symbols for architecture x86_64: "boost::system::system_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o boost::asio::error::get_system_category() in main.o "boost::system::generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o "boost::asio::error::get_netdb_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o "boost::asio::error::get_addrinfo_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o "boost::asio::error::get_misc_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/20/20d5ly4n7qv3d61_30dd5x180000gn/T//ccfhHDpX.out (No such file or directory) make: *** [01_timer.app/Contents/MacOS/01_timer] Error 1 make: Leaving directory /Users/qinsisi/test/timer'
    03:39:24: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project 01_timer (target: Desktop)
    When executing step 'Make'
    @

    I have tried to do this,
    macx:CONFIG -= x86
    macx:CONFIG -= x86_64
    but failed.

    i also tried to right click on project and go to "Add Library"
    I tried "external Library" and "system library", but I cannot see /opt/local/ folder so that i cannot select the directories.

    Anyway, thanks in advance.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hostel
      wrote on last edited by
      #2

      "Example from documentation":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#libs
      @
      unix:LIBS += -L/usr/local/lib -lmath // you don't have -l
      win32:LIBS += c:/mylibs/math.lib
      @

      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