Problem to compile boost library in QT

1

Hi, I'm trying to use this library in a project in QT but I never recognize it. Basically I put these libraries:

#include <boost/bind.hpp>

Code of my project:

QT += core
QT -= gui

CONFIG += C++11

QMAKE_CXXFLAGS = -std=c++11

TARGET = intento
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app

SOURCES += main.cpp \
    scheduler.cpp

HEADERS += \
    scheduler.h \
    standard_miner.hpp

What I do is the following: download the precompiled boost library: link

But now I have to include it in my project or what should I do ???

Program reference: link

And obviously he does not recognize them. So what I have is that download them and say include them to my program I think since I can not think of another way

    
asked by Perl 05.11.2016 в 17:37
source

1 answer

2

What do you mean he does not recognize them? The compiler complains that he can not find the file, the linker complains that he can not find the library ?, What is the exact message?

Are the Boost libraries properly installed?

Is it necessary to tell qmake where to find the headers? link

Do you tell qmake the external libraries to use? link

EDITO

qmake has options to indicate both the routes to the header files and the libraries to link.

INCLUDEPATH : paths in which to search the header files. Like any other qmake variable, you can assign (forgetting the previous value) by INCLUDEPATH= , or you can add content, by placing them next to the previous (if any) by INCLUDEPATH+=

  

INCLUDEPATH

     

Specifies the #include directories which should be searched when   compiling the project.

     

For example:

     

INCLUDEPATH = c: / msdev / include d: / stl / include To specify a path   containing spaces, quote the path using the technique described in   Whitespace.

     

win32: INCLUDEPATH +="C: / mylibs / extra headers" unix: INCLUDEPATH + =   "/ home / user / extra headers"

LIBS : libraries to link. As a variable that is, you can assign a value with LIBS= or add to the previous one using LIBS+= .

  

LIBS

     

Specifies a list of libraries to be linked to the project. if you   use the Unix -l (library) and -L (library path) flags, qmake handles   the libraries correctly on Windows (that is, passes the full path of   the library to the linker). The library must exist for qmake to find   the directory where a -l lib is located.

     

For example:

     

unix: LIBS + = -L / usr / local / lib -lmath win32: LIBS + = c: /mylibs/math.lib   To specify a path containing spaces, quote the path using the   technique described in Whitespace.

     

win32: LIBS +="C: / mylibs / extra libs / extra.lib" unix: LIBS + =   "-L / home / user / extra libs" -lextra

    
answered by 05.11.2016 / 19:18
source