简体   繁体   中英

Qt: Include .pri to use library - incorrect includes

I'm trying to use QtSerialPort ( http://qt-project.org/wiki/QtSerialPort ) with Qt 4.8. It's not part of that version, so I have to install it manually. To avoid to manually install it, I just wanted to include the .pri file that is shipped with QtSerialPort. I got my copy by doing "git clone https://git.gitorious.org/qt/qtserialport.git ". Using it in my *.pro file with:

include(qtserialport/src/serialport/serialport-lib.pri)

But compiling fails bc. of includes like:

#include <QtSerialPort/qserialportglobal.h>

So I guess these includes resolve to something like /usr/include etc. Is there any way to fix this without changing all the includes from to "foo.h" manually?

So I guess these includes resolve to something like /usr/include etc. Is there any way to fix this without changing all the includes from to "foo.h" manually?

Yes, sure.

First, you would need to write CONFIG += serialport as per documentation.

You could also specify the includepath to the qtserialport clone on your system.

You would still need to get the library built, but I assume that you are aware of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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