Compilation issues on Linux/CMake with Musescore 2.1 zip archive
I encountered several compilation issues for Musescore 2.1 zip archive on Linux Fedore 25 using cmake.
I am trying to make a more recent RPM package on Fedora copr.
I tested my build and it looks ok.
Setup:
- compilation was performed in a build directory
- LAM was disabled (as in Fedora spec)
- prefix is /usr/local
- other options as default
0) make or cmake ???
Manual don't mention cmake but make. Why ???
1) Issue when lame is off in ccmake: we have to clear LAME_XXX variables else it complains these variables are unset.
2) all.h
> Scanning dependencies of target manpages
> [ 0%] Generating mscore.1.gz
> Man pages have been compressed ready for installation.
> Creating symlink alias for man pages.
> Symlink alias: musescore.1.gz -> mscore.1.gz
> [ 0%] Built target manpages
> Scanning dependencies of target qtsingleapp_autogen
> make[2]: *** No rule to make target 'all.h', needed by 'thirdparty/singleapp/src/CMakeFiles/qtsingleapp_autogen'. Stop.
> CMakeFiles/Makefile2:8789: recipe for target 'thirdparty/singleapp/src/CMakeFiles/qtsingleapp_autogen.dir/all' failed
> make[1]: *** [thirdparty/singleapp/src/CMakeFiles/qtsingleapp_autogen.dir/all] Error 2
> Makefile:151: recipe for target 'all' failed
> make: *** [all] Error 2
I copied manually all.h from source to continue
3) Then g++ complains about -fPIC due to Qt setup
(unfortunately I lost the error message)
I added it to compile all.h
> /usr/lib64/ccache/c++ -fPIC -x c++-header -g -I/usr/include/qt5/ ... -o all.h.gch all.h
4) MP3 code issue (LAM is disabled)
> cc1plus: warning: /home/scratch/sources/MuseScore-2.1-build/all.h.gch: created and used with differing settings of '-maccumulate-outgoing-args'
> [ 83%] Linking CXX executable mscore
> ^[O3S^[O3SCMakeFiles/mscore.dir/loginmanager.cpp.o: In function Ms::LoginManager::onGetMediaUrlRequestReady(QByteArray)':
Ms::MuseScore::saveMp3(Ms::Score*, QString const&)'
> /home/scratch/sources/MuseScore-2.1/mscore/loginmanager.cpp:406: undefined reference to
> CMakeFiles/mscore.dir/uploadscoredialog.cpp.o: In function Ms::UploadScoreDialog::showOrHideUploadAudio()':
Ms::MuseScore::canSaveMp3()'
> /home/scratch/sources/MuseScore-2.1/mscore/uploadscoredialog.cpp:196: undefined reference to
> collect2: error: ld returned 1 exit status
> mscore/CMakeFiles/mscore.dir/build.make:5885: recipe for target 'mscore/mscore' failed
> make[2]: *** [mscore/mscore] Error 1
> CMakeFiles/Makefile2:324: recipe for target 'mscore/CMakeFiles/mscore.dir/all' failed
> make[1]: *** [mscore/CMakeFiles/mscore.dir/all] Error 2
> Makefile:151: recipe for target 'all' failed
> make: *** [all] Error 2
I fixed theses 2 methods
- void UploadScoreDialog::showOrHideUploadAudio()
- void LoginManager::onGetMediaUrlRequestReady(QByteArray ba)
5) At install
> -- Up-to-date: /usr/local/stow/MuseScore-2.1/share/mscore-2.1/wallpaper/paper5.png
> CMake Error at share/locale/cmake_install.cmake:36 (file):
> file INSTALL cannot find
> "/home/scratch/sources/MuseScore-2.1/share/locale/mscore_af.qm".
> Call Stack (most recent call first):
> share/cmake_install.cmake:43 (include)
> cmake_install.cmake:57 (include)
> Makefile:73: recipe for target 'install' failed
> make: *** [install] Error 1
These files are not generated ???
Comments
Duplicate of https://musescore.org/en/node/256016