MuseScore2 doesn't compile on FreeBSD
I try to port MuseScore for FreeBSD but there is a lot of errors. After add include "all.h" into synthesizergui, I have this errors:
===> Building for musescore-2.0
gmake[2] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
gmake[3] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
gmake[4] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
Scanning dependencies of target mops2
gmake[4] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
[ 0%] Built target mops2
gmake[4] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
Scanning dependencies of target mops1
gmake[4] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
gmake[4] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
gmake[4]: Dépendance circulaire all.h <- all.h abandonnée.
gmake[4] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
[ 0%] Built target mops1
gmake[4] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
[ 0%] Generating ui_zerberus_gui.h
[ 0%] Generating moc_zerberusgui.cpp
Scanning dependencies of target zerberus
gmake[4] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
gmake[4] : on entre dans le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
[ 0%] Building CXX object zerberus/CMakeFiles/zerberus.dir/moc_zerberusgui.cpp.o
In file included from musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:9:
In file included from musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberusgui.h:16:
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:24:31: error: expected class name
class SynthesizerGui : public QWidget {
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:25:7: error: unknown type name 'Q_OBJECT'
Q_OBJECT
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:26:18: error: expected ';' at end of declaration list
Synthesizer* _synthesizer;
^
;
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:28:4: error: unknown type name 'signals'
signals:
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:29:12: error: expected '(' for function-style cast or type construction
void sfChanged();
~~~~ ^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:32:10: error: expected ':'
public slots:
^
:
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:32:11: error: unknown type name 'slots'
public slots:
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:33:7: error: expected expression
virtual void synthesizerChanged() {}
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:37:7: error: must use 'class' tag to refer to type 'Synthesizer' in this scope
Synthesizer* synthesizer() { return _synthesizer; }
^
class
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:26:7: note: class 'Synthesizer' is hidden by a non-type declaration of 'Synthesizer' here
Synthesizer* _synthesizer;
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:37:43: error: use of undeclared identifier '_synthesizer'; did you mean 'synthesizer'?
Synthesizer* synthesizer() { return _synthesizer; }
^~~~~~~~~~~~
synthesizer
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:37:20: note: 'synthesizer' declared here
Synthesizer* synthesizer() { return _synthesizer; }
^
musescore2/work/musescore-MuseScore-a925ae0/synthesizer/synthesizergui.h:37:43: error: reference to non-static member function must be called; did you mean to call it with no arguments?
Synthesizer* synthesizer() { return _synthesizer; }
^~~~~~~~~~~~
()
In file included from musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:9:
In file included from musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberusgui.h:18:
musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberus.h:121:14: error: unknown type name 'QFileInfoList'
static QFileInfoList sfzFiles();
^
In file included from musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:9:
musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberusgui.h:26:30: error: base class has incomplete type
class SfzListDialog : public QDialog {
~~~~~~~^~~~~~~
/usr/local/include/qt5/QtGui/qwindowdefs.h:57:7: note: forward declaration of 'QDialog'
class QDialog;
^
In file included from musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:9:
musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberusgui.h:48:7: error: unknown type name 'QFutureWatcher'
QFutureWatcher _futureWatcher;
^
musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberusgui.h:48:21: error: expected member name or ';' after declaration specifiers
QFutureWatcher _futureWatcher;
~~~~~~~~~~~~~~^
musescore2/work/musescore-MuseScore-a925ae0/zerberus/zerberusgui.h:66:48: error: cannot initialize object parameter of type 'Ms::SynthesizerGui' with an expression of type 'ZerberusGui'
Zerberus* zerberus() { return (Zerberus*)synthesizer(); }
^~~~~~~~~~~
musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:67:29: error: static_cast from 'QObject *' to 'SfzListDialog *' is not allowed
SfzListDialog *_t = static_cast(_o);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:76:8: error: incomplete type 'QDialog' named in nested name specifier
{ &QDialog::staticMetaObject, qt_meta_stringdata_SfzListDialog.data,
^~~~~~~~~
/usr/local/include/qt5/QtGui/qwindowdefs.h:57:7: note: forward declaration of 'QDialog'
class QDialog;
^
musescore2/work/musescore-MuseScore-a925ae0/zerberus/moc_zerberusgui.cpp:83:21: error: invalid use of non-static data member 'd_ptr'
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
~~~~~~~~~^~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
zerberus/CMakeFiles/zerberus.dir/build.make:63 : la recette pour la cible « zerberus/CMakeFiles/zerberus.dir/moc_zerberusgui.cpp.o » a échouée
gmake[4]: *** [zerberus/CMakeFiles/zerberus.dir/moc_zerberusgui.cpp.o] Erreur 1
gmake[4] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
CMakeFiles/Makefile2:4909 : la recette pour la cible « zerberus/CMakeFiles/zerberus.dir/all » a échouée
gmake[3]: *** [zerberus/CMakeFiles/zerberus.dir/all] Erreur 2
gmake[3] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
Makefile:137 : la recette pour la cible « all » a échouée
gmake[2]: *** [all] Erreur 2
gmake[2] : on quitte le répertoire « musescore2/work/musescore-MuseScore-a925ae0 »
*** Error code 1
Stop.
make[1]: stopped in musescore2
*** Error code 1
Stop.
Comments
Hi,
Can you remove all.h from synthesizergui and paste your errors from a vanilla code compilation? then paste the errors to http://paste.kde.org ?
If you are doing this just right now and want to chat about it, feel free to join IRC #musescore on freenode.net.
In reply to Hi, Can you remove all.h from by [DELETED] 5
Here the paste:
https://paste.kde.org/pzwtmxl42
Thanks.
In reply to Here the by bartbecker
The installation of Qt is probably incomplete or not good. Can you give the output of qmake -v ?
Qt5 is correctly installed with all modules.
In fact, it missing header in source (see for first files: https://paste.kde.org/piemfckkz)
or there's a problem with the CMakeLists.txt and all.h?
In reply to Qt5 is correctly installed by bartbecker
Compilation is working without adding "include" on Linux, Windows and Mac. So there must be something we need to change in CMake configuration to make it work on FreeBSD.
Since it seems there is a problem with the precompiled header, can you try to define BUILD_PCH to false like on Windows https://github.com/musescore/MuseScore/blob/master/CMakeLists.txt#L371
or try to debug the precompiled header creation in
build/CreatePrecompiledHeader.cmake
https://github.com/musescore/MuseScore/blob/master/build/CreatePrecompi…
OK. I fixed this problem forcing CXX to GNU and not Clang. Now, I have an error from G++48:
[ 36%] Building CXX object libmscore/CMakeFiles/libmscore.dir/chordrest.cpp.o
cd /wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0/libmscore && /usr/local/bin/g++48 -DQT_DISABLE_DEPRECATED_BEFORE=0 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc48 -std=c++11 -fPIC -O2 -DNDEBUG -DQT_NO_DEBUG -fPIC -I/wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0/libmscore -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtCore -I/usr/local/lib/qt5/mkspecs/freebsd-clang -I/usr/local/include/qt5/QtWidgets -I/usr/local/include/qt5/QtPrintSupport -I/usr/local/include/qt5/QtSvg -I/usr/local/include/qt5/QtDeclarative -I/usr/local/include/qt5/QtScript -I/usr/local/include/qt5/QtScriptTools -I/usr/local/include/qt5/QtNetwork -I/usr/local/include/qt5/QtTest -I/usr/local/include/qt5/QtDesigner -I/usr/local/include/qt5/QtXml -I/usr/local/include/qt5/QtConcurrent -I/usr/local/include/qt5/QtXmlPatterns -I/usr/local/include/qt5/QtUiTools -I/usr/local/include/qt5/QtQml -I/usr/local/include/qt5/QtQuick -I/usr/local/include/qt5/QtQuickWidgets -I/usr/local/include/qt5/QtWebKit -I/usr/local/include/qt5/QtWebKitWidgets -I/usr/local/include/qt5/QtSql -I/usr/local/include/qt5/QtOpenGL -I/wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0 -I/usr/local/include/portaudio2 -I/usr/local/include -g -include /wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0/all.h -Wall -Wextra -Winvalid-pch -o CMakeFiles/libmscore.dir/chordrest.cpp.o -c /wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0/libmscore/chordrest.cpp
In file included from /usr/local/lib/gcc48/include/c++/bits/stl_algo.h:66:0,
from /usr/local/lib/gcc48/include/c++/algorithm:62,
from /usr/local/include/qt5/QtCore/qglobal.h:89,
from /usr/local/include/qt5/QtCore/qnamespace.h:45,
from /usr/local/include/qt5/QtCore/qobjectdefs.h:49,
from /usr/local/include/qt5/QtCore/qobject.h:48,
from /usr/local/include/qt5/QtCore/qabstractanimation.h:45,
from /usr/local/include/qt5/QtCore/QtCore:4,
from /usr/local/include/qt5/QtGui/QtGuiDepends:2,
from /usr/local/include/qt5/QtGui/QtGui:3,
from all.h:32:
/usr/local/lib/gcc48/include/c++/functional: In instantiation of 'static bool std::_Function_base::_Base_manager<_Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Functor = Ms::Chord::setTrack(int)::__lambda0]':
/usr/local/lib/gcc48/include/c++/functional:2460:19: required from 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = Ms::Chord::setTrack(int)::__lambda0; = void; _Res = void; _ArgTypes = {Ms::Element*}]'
/wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0/libmscore/chord.cpp:1207:64: required from here
/usr/local/lib/gcc48/include/c++/functional:1938:45: internal compiler error: in typeid_ok_p, at cp/rtti.c:307
__dest._M_access() = &typeid(_Functor);
^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
libmscore/CMakeFiles/libmscore.dir/build.make:2426: recipe for target 'libmscore/CMakeFiles/libmscore.dir/chord.cpp.o' failed
gmake[3]: *** [libmscore/CMakeFiles/libmscore.dir/chord.cpp.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[3]: Leaving directory '/wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0'
CMakeFiles/Makefile2:668: recipe for target 'libmscore/CMakeFiles/libmscore.dir/all' failed
gmake[2]: *** [libmscore/CMakeFiles/libmscore.dir/all] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0'
Makefile:140: recipe for target 'all' failed
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/audio/musescore2/work/musescore-MuseScore-a925ae0'