Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails using Qt 5.8 #6

Open
lassade opened this issue Feb 17, 2017 · 8 comments
Open

Build fails using Qt 5.8 #6

lassade opened this issue Feb 17, 2017 · 8 comments

Comments

@lassade
Copy link

lassade commented Feb 17, 2017

I'm messing with the project for a quite while now, trying to figure out why I got this error when building:

In file included from ./cpp/private/qobject_p.h:2:0,
                 from /usr/include/qt/QtCore/5.8.0/QtCore/private/qmetaobject_p.h:58,
                 from ./cpp/private/qmetaobject_p.h:2,
                 from ./cpp/govalue.h:7,
                 from ./cpp/capi.cpp:11,
                 from ./all.cpp:2:
/usr/include/qt/QtCore/5.8.0/QtCore/private/qobject_p.h:55:38: fatal error: QtCore/private/qglobal_p.h: No such file or directory
 #include <QtCore/private/qglobal_p.h>
                                      ^

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@lassade
Copy link
Author

lassade commented Feb 17, 2017

I go it working, after compiling an empty qt project with QT += core-private added to my .pro file i found out that the headers must be included with -isystem:

diff --git a/bridge.go b/bridge.go
index fa11261..1805108 100644
--- a/bridge.go
+++ b/bridge.go
@@ -1,6 +1,7 @@
 package qml

 // #cgo CPPFLAGS: -I./cpp
+// #cgo CPPFLAGS: -isystem /usr/include/qt/QtCore/5.8.0 -isystem /usr/include/qt/QtCore/5.8.0/QtCore
 // #cgo CXXFLAGS: -std=c++0x -pedantic-errors -Wall -fno-strict-aliasing
 // #cgo LDFLAGS: -lstdc++
 // #cgo pkg-config: Qt5Core Qt5Widgets Qt5Quick

This fixes the problem, but creates the need of specifying include dirs for each qt version.

@neclepsio
Copy link

I had the same problem compiling under Windows mingw64; I fixed adding /mingw64/include/QtCore/5.8.0 to CPATH.

@upperxcode
Copy link

try
sudo ln -s /usr/include/qt/QtCore/5.8.0/QtCore/ /usr/include/

@ibm-enio
Copy link

I'm getting this error on a Mac, how did you fix it?

@lassade
Copy link
Author

lassade commented May 19, 2018

Looks like creating a symling like upperxcode mentions is simplest way to go

try
sudo ln -s /usr/include/qt/QtCore/5.8.0/QtCore/ /usr/include/

@ibm-enio
Copy link

That solution doesn't work, I get the error below:

ln: /usr/include/QtCore: Operation not permitted

I believe this is due to apple's new System Integrity Protection feature, which prevents changes to several core parts of OS X, including most of /usr, even by root. Is there any other way to work around this issue?

@upperxcode
Copy link

upperxcode commented May 23, 2018

on Linux I use sudo to have access to the folders. I do not know how it works on Mac.
Another solution would be to set the environment variables in your IDE. Doing this is relatively easy in QtCreator, something like:
project.pro
.
.
.
INCLUDEPATH += /usr/include/qt/QtSql
INCLUDEPATH += /usr/include/qt/QtWidgets
INCLUDEPATH += /usr/include/qt/QtPrintSupport

The only disadvantage is that this will only be visible to the concerned IDE

@geoffreymantel
Copy link

Had this problem on Ubuntu 18.04, but build proceeded for me after I did: sudo apt-get install qtbase5-private-dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants