I started using Qt Creator 2.8.2 on mac osx 10.9.4 for sailfish OS application development (Downloaded Qt Creator from https://sailfishos.org)
If I want to compile a sample c++ file including header from boost, the compilation fails showing
“fatal error: boost/shared_ptr.hpp: No such file or directory”.
I downloaded boost 1.55.0_2 with brew (brew install boost —with-c++11) and all necessary header files are in “/usr/local/Cellar/boost/1.55.0_2/include/boost” aliasing to “/usr/local/include/boost/”.
In my *.pro file, I added
INCLUDEPATH += /usr/local/include/
and
LIBS += /usr/local/lib/
But this doesn’t help, I still can’t use boost header files because of
/app/src/harbour-wlan-keyboard.cpp:41:32: fatal error: boost/shared_ptr.hpp: No such file or directory"
Do you have any idea whats wrong here?
/* Compiler output */
14:39:44: Running steps for project harbour-wlan-keyboard...
14:39:44: Starting: "/Users/abertschi/.config/SailfishAlpha4/mer-sdk-tools/MerSDK/SailfishOS-i486/qmake" /Users/abertschi/src-proj/sailfish-wlan-keyboard/app/harbour-wlan-keyboard.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
Building target platforms: i486-meego-linux-gnu
Building for target i486-meego-linux-gnu
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.7aqDeI
14:39:46: The process "/Users/abertschi/.config/SailfishAlpha4/mer-sdk-tools/MerSDK/SailfishOS-i486/qmake" exited normally.
14:39:46: Starting: "/Users/abertschi/.config/SailfishAlpha4/mer-sdk-tools/MerSDK/SailfishOS-i486/make"
Building target platforms: i486-meego-linux-gnu
Building for target i486-meego-linux-gnu
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.T01IUh
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -m32 -march=i486 -fasynchronous-unwind-tables -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++ -I../app -I../app/src/lib -I/usr/local/include -I/usr/include/sailfishapp -I/usr/include/mdeclarativecache5 -I/usr/include/qt5 -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o harbour-wlan-keyboard.o ../app/src/harbour-wlan-keyboard.cpp
../app/src/harbour-wlan-keyboard.cpp:41:32: fatal error: boost/shared_ptr.hpp: No such file or directory
compilation terminated.
/* sample c++ file */
#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif
#include <sailfishapp.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <stdexcept>
#include <vector>
#include <boost/shared_ptr.hpp>
using namespace std;
int main(int argc, char *argv[])
{
// SailfishApp::main() will display "qml/template.qml", if you need more
// control over initialization, you can use:
//
// - SailfishApp::application(int, char *[]) to get the QGuiApplication *
// - SailfishApp::createView() to get a new QQuickView * instance
// - SailfishApp::pathTo(QString) to get a QUrl to a resource file
//
// To display the view, call "show()" (will show fullscreen on device).
/*return SailfishApp::main(argc, argv);*/
return 0;
}
/* pro file */
TARGET = harbour-wlan-keyboard
CONFIG += sailfishapp
SOURCES += src/harbour-wlan-keyboard.cpp
INCLUDEPATH += src/lib/
INCLUDEPATH += /usr/local/include/
LIBS += /usr/local/lib/
OTHER_FILES += qml/harbour-wlan-keyboard.qml \
qml/cover/CoverPage.qml \
qml/pages/FirstPage.qml \
qml/pages/SecondPage.qml \
rpm/harbour-wlan-keyboard.changes.in \
rpm/harbour-wlan-keyboard.spec \
rpm/harbour-wlan-keyboard.yaml \
translations/*.ts \
harbour-wlan-keyboard.desktop
# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
TRANSLATIONS += translations/harbour-wlan-keyboard-de.ts
↧
Qt Creator on mac osx: c++ headers not being found / boost/shared_ptr.hpp: No such file or directory
↧