compile error on osx #13

Closed
timblechmann opened this Issue Sep 14, 2013 · 4 comments

Comments

Projects
None yet
2 participants

compiling on osx, i get the following error:

FAILED: /usr/bin/c++   -DEXIV2 -DGM -DPHONON -DQT_CORE_LIB -DQT_DEBUG -DQT_GUI_LIB -DQT_PHONON_LIB -DQT_SQL_LIB -g -isystem /usr/local/Cellar/qt/4.8.5/include -F/usr/local/Cellar/qt/4.8.5/lib -isystem /usr/local/Cellar/qt/4.8.5/include/phonon -isystem /usr/local/Cellar/qt/4.8.5/include/QtGui -isystem /usr/local/Cellar/qt/4.8.5/include/QtSql -isystem /usr/local/Cellar/qt/4.8.5/lib/QtCore.framework/Headers -I. -I/usr/include/GraphicsMagick -MMD -MT CMakeFiles/photoqt.dir/settings/settingstabexif.cpp.o -MF "CMakeFiles/photoqt.dir/settings/settingstabexif.cpp.o.d" -o CMakeFiles/photoqt.dir/settings/settingstabexif.cpp.o -c ../settings/settingstabexif.cpp
In file included from ../settings/settingstabexif.cpp:17:
../settings/settingstabexif.h:27:89: error: expected ')'
        SettingsTabExif(QWidget *parent = 0, QMap<QString,QVariant> set = QMap<QString,QVariant>(), bool verbose = false);
                                                                                               ^
../settings/settingstabexif.h:27:17: note: to match this '('
        SettingsTabExif(QWidget *parent = 0, QMap<QString,QVariant> set = QMap<QString,QVariant>(), bool verbose = false);
                       ^
../settings/settingstabexif.h:27:80: error: expected '>'
        SettingsTabExif(QWidget *parent = 0, QMap<QString,QVariant> set = QMap<QString,QVariant>(), bool verbose = false);
                                                                                      ^
../settings/settingstabexif.h:27:89: error: missing default argument on parameter
        SettingsTabExif(QWidget *parent = 0, QMap<QString,QVariant> set = QMap<QString,QVariant>(), bool verbose = false);
                                                                                               ^
../settings/settingstabexif.cpp:20:18: error: out-of-line definition of 'SettingsTabExif' does not match any declaration in 'SettingsTabExif'
SettingsTabExif::SettingsTabExif(QWidget *parent, QMap<QString, QVariant> set, bool v) : QWidget(parent) {
Owner

luspi commented Sep 16, 2013

Oh, I think I have been told about this problem before. I actually thought I took care of it, but might have forgotten some headers: On osx you also need to include the QVariant header in some files (like the settingstabexif.h). This is not needed on Linux (this header is included by another included header already), that's why I didn't specify it again in this file.
You can either add the following line to the header yourself or you can simply re-download the code from here, I just added the line there, de417ff

The line you need to add to all the other include statements in settings/settingstabexif.h:

#include <QVariant>

I hope that resolves the problem.

not quite:

FAILED: /usr/bin/c++   -DGM -DPHONON -DQT_CORE_LIB -DQT_DEBUG -DQT_GUI_LIB -DQT_PHONON_LIB -DQT_SQL_LIB -g -isystem /usr/local/Cellar/qt/4.8.5/include -F/usr/local/Cellar/qt/4.8.5/lib -isystem /usr/local/Cellar/qt/4.8.5/include/phonon -isystem /usr/local/Cellar/qt/4.8.5/include/QtGui -isystem /usr/local/Cellar/qt/4.8.5/include/QtSql -isystem /usr/local/Cellar/qt/4.8.5/lib/QtCore.framework/Headers -I. -I/usr/local/include/GraphicsMagick -MMD -MT CMakeFiles/photoqt.dir/main.cpp.o -MF "CMakeFiles/photoqt.dir/main.cpp.o.d" -o CMakeFiles/photoqt.dir/main.cpp.o -c ../main.cpp
In file included from ../main.cpp:25:
In file included from ../mainwindow.h:9:
../globalsettings.h:946:67: error: expected ')'
        void saveSettings(QMap<QString,bool> applySet = QMap<QString,bool>()) {
                                                                         ^
../globalsettings.h:946:19: note: to match this '('
        void saveSettings(QMap<QString,bool> applySet = QMap<QString,bool>()) {
                         ^
../globalsettings.h:946:62: error: expected '>'
        void saveSettings(QMap<QString,bool> applySet = QMap<QString,bool>()) {
                                                                    ^
../globalsettings.h:1362:24: error: too few arguments to function call, expected 2, have 1
                saveSettings(applySet);
                ~~~~~~~~~~~~         ^
../globalsettings.h:946:2: note: 'saveSettings' declared here
        void saveSettings(QMap<QString,bool> applySet = QMap<QString,bool>()) {
        ^

also note that i had to change the include paths:
/usr/local/include/GraphicsMagick
btw, hardcoded include paths are not really nice, but it seems that cmake provides an FindMagick.cmake file, which can probably be used.

Owner

luspi commented Sep 17, 2013

Hm, at first glance I would have said that that's a similar problem, that the QMap header is missing. However, the QMap is included in this file. Your compiler though doesn't seem to like the two empty brackets at the end of the default value of the function parameter. It would be a little odd if that's the problem (since it doesn't compile on Linux if they're missing), but give it a shot. It's line #946 in globalsettings.h. It should look like this afterwards:
void saveSettings(QMap<QString,bool> applySet = QMap<QString,bool>) {

I just had a look at the FindMagick.cmake and it actually looks pretty good. I'll probably add it soon to avoid the hard-coded path.

Owner

luspi commented Oct 13, 2014

luspi closed this Oct 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment