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

scons qt5 on linux platform #54

Open
pkestene opened this issue Nov 27, 2017 · 6 comments
Open

scons qt5 on linux platform #54

pkestene opened this issue Nov 27, 2017 · 6 comments

Comments

@pkestene
Copy link

pkestene commented Nov 27, 2017

building on linux (at least my Ubuntu 17.04 machine) requires to slightly patch data/scons/qt5.py
because Qt is not found, while it is available.
Fix is simple:

pcmodules = [module+debugSuffix for module in ...

should be changed into

pcmodules = [module.replace('Qt','Qt5')+debugSuffix for module in ...

@davidgiven
Copy link

I can confirm that I both have this problem (on Debian unstable) and that the suggested fix fixes it.

@davidgiven
Copy link

...well, up to a point. I also had to hack the config.py file to add -fPIC to the compiler flags, or else Qt would bail out with an error. (But you can't use -fPIE as well.)

Unfortunately, whether you need -fPIC or not appears to depend on the compilation options for the Qt library itself, so knowing whether we need it or not seems hard. I'd have thought pkg-config would know, but it seems not to...

@KirillLykov
Copy link

I'm on clean Ubuntu 16.04 and tried to build mitsuba with Qt5. The described modifications are not enough for my case. I did what described in this thread. After that,I fixed header (QtGui -> QtWidgets migration). I also removed all occurrences of UnicodeUTF8.
Finally, I've got error:
build/release/mtsgui/moc_aboutdlg.cc:13:2: error: #error "This file was generated using the moc from 4.8.7. It cannot be used with the include files from this version of Qt. (The moc has changed too much.)"

And them some other errors in the same file
build/release/mtsgui/moc_aboutdlg.cc:55:7: error: ‘QMetaObjectExtraData’ does not name a type const QMetaObjectExtraData AboutDialog::staticMetaObjectExtraData = { ^ build/release/mtsgui/moc_aboutdlg.cc:61:34: error: ‘staticMetaObjectExtraData’ was not declared in this scope qt_meta_data_AboutDialog, &staticMetaObjectExtraData } ^ build/release/mtsgui/moc_aboutdlg.cc: In member function ‘virtual const QMetaObject* AboutDialog::metaObject() const’: build/release/mtsgui/moc_aboutdlg.cc:70:71: error: conditional expression between distinct pointer types ‘QDynamicMetaObjectData*’ and ‘const QMetaObject*’ lacks a cast return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;

@davidgiven
Copy link

Debian/Ubuntu have (IIRC) a moc wrapper which uses an environment variable to decide whether to run the Qt4 moc or the Qt5 one. I suspect I don't have Qt4 installed, so it always picks the Qt5 one for me.

You might try doing export QT_SELECT=5 before the build and seeing what happens (you'll need to clean first).

@KirillLykov
Copy link

It worked! I also had to add -std=c++14 to config.py complier flags.

@ydawei
Copy link

ydawei commented Feb 3, 2018

pkestene's fix did not work for me. Instead, I hardcoded the list:
pcmodules = ['QtGui', 'Qt5Widgets', 'QtCore', 'Qt5OpenGL', 'QtXml', 'QtXmlPatterns', 'QtNetwork'].

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

4 participants