简体   繁体   English

如何在RPI2上将Boost Library添加到QTCreator?

[英]How add Boost Library to QTCreator on RPI2?

I need the boost library for a project on my Raspberry Pi 2. I use QTCreator for coding but I cant add the Library. 我需要在我的Raspberry Pi 2上为项目提升库。我使用QTCreator进行编码,但我无法添加库。 I tried to add this to the .pro file of my project in QTCreator: 我试着将它添加到QTCreator中我项目的.pro文件中:

LIBS += -L/usr/include/boost -lboost_chrono

I installed the boost Library using: 我使用以下方法安装了boost库:

sudo apt-get install libboost1.55-all

If I try to compile my code I get the "boost/chrono.hpp no such file or directory". 如果我尝试编译我的代码,我得到“boost / chrono.hpp没有这样的文件或目录”。 I read somewhere that I have to compile the Library first using the same compiler as QtCreator (usually mingw) but I have no clue how to do that.(Im a beginner with the raspberry and the linux system in general) 我在某处读到了我必须首先使用与QtCreator相同的编译器编译库(通常是mingw),但我不知道如何做到这一点。(我是初学者,一般是覆盆子和linux系统)

Thx for your help 谢谢你的帮助

LIBS += -L

This adds a path to the linker. 这会添加链接器的路径。 Your error is related to a path in the include. 您的错误与包含中的路径有关。 You should add the boost path via 您应该通过添加增强路径

INCLUDEPATH +=

As mentioned here: How to add include path in Qt Creator? 如上所述: 如何在Qt Creator中添加包含路径?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM