rncbc / qtractor

Qtractor - An Audio/MIDI multi-track sequencer
https://qtractor.org
GNU General Public License v2.0
499 stars 87 forks source link

Problem building qtractor with CLAP enabled on older system #350

Closed suedwestlicht closed 6 months ago

suedwestlicht commented 2 years ago

Even the most recent version of Qtractor builds fine on my well tuned and beloved Xubuntu 16.04.7 LTS with Qt 5.5.1

But trying to build Qtractor with CLAP enabled fails. Any chance for a simple and quick fix?

[  6%] Building CXX object src/CMakeFiles/qtractor.dir/qtractorClapPlugin.cpp.o
In file included from /home/hm/src/qtractor/qtractor/src/qtractorLv2Plugin.h:37:0,
                 from /home/hm/src/qtractor/qtractor/src/qtractorMidiManager.h:51,
                 from /home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.cpp:31:
/home/hm/src/qtractor/qtractor/src/lv2/lv2_atom_helpers.h:220:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wstringop-overflow"
                                ^
/home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.cpp: In member function 'void qtractorClapPluginHost::clear(const clap_host*)':
/home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.cpp:1205:42: error: no matching function for call to 'QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::TimerItem*>::erase(QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::TimerItem*>::ConstIterator&)'
    timer_iter = m_timers.erase(timer_iter);
                                          ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QHash:1:0,
                 from /home/hm/src/qtractor/qtractor/src/qtractorMidiControl.h:29,
                 from /home/hm/src/qtractor/qtractor/src/qtractorTrack.h:27,
                 from /home/hm/src/qtractor/qtractor/src/qtractorEngine.h:25,
                 from /home/hm/src/qtractor/qtractor/src/qtractorPlugin.h:25,
                 from /home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.h:25,
                 from /home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.cpp:26:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:876:55: note: candidate: QHash<Key, T>::iterator QHash<Key, T>::erase(QHash<Key, T>::iterator) [with Key = qtractorClapPluginHost::Key; T = qtractorClapPluginHost::TimerItem*]
 Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::iterator QHash<Key, T>::erase(iterator it)
                                                       ^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:876:55: note:   no known conversion for argument 1 from 'QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::TimerItem*>::ConstIterator {aka QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::TimerItem*>::const_iterator}' to 'QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::TimerItem*>::iterator'
/home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.cpp:1217:51: error: no matching function for call to 'QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::PosixFdItem*>::erase(QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::PosixFdItem*>::ConstIterator&)'
    posix_fd_iter = m_posix_fds.erase(posix_fd_iter);
                                                   ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QHash:1:0,
                 from /home/hm/src/qtractor/qtractor/src/qtractorMidiControl.h:29,
                 from /home/hm/src/qtractor/qtractor/src/qtractorTrack.h:27,
                 from /home/hm/src/qtractor/qtractor/src/qtractorEngine.h:25,
                 from /home/hm/src/qtractor/qtractor/src/qtractorPlugin.h:25,
                 from /home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.h:25,
                 from /home/hm/src/qtractor/qtractor/src/qtractorClapPlugin.cpp:26:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:876:55: note: candidate: QHash<Key, T>::iterator QHash<Key, T>::erase(QHash<Key, T>::iterator) [with Key = qtractorClapPluginHost::Key; T = qtractorClapPluginHost::PosixFdItem*]
 Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::iterator QHash<Key, T>::erase(iterator it)
                                                       ^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:876:55: note:   no known conversion for argument 1 from 'QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::PosixFdItem*>::ConstIterator {aka QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::PosixFdItem*>::const_iterator}' to 'QHash<qtractorClapPluginHost::Key, qtractorClapPluginHost::PosixFdItem*>::iterator'
src/CMakeFiles/qtractor.dir/build.make:421: recipe for target 'src/CMakeFiles/qtractor.dir/qtractorClapPlugin.cpp.o' failed
make[2]: *** [src/CMakeFiles/qtractor.dir/qtractorClapPlugin.cpp.o] Error 1
CMakeFiles/Makefile2:129: recipe for target 'src/CMakeFiles/qtractor.dir/all' failed
make[1]: *** [src/CMakeFiles/qtractor.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
rncbc commented 2 years ago

you need Qt >= 5.7, sorry

OTOH. on those kind of older systems, it's unlikely that the newer CLAP plugin binaries will ever load or run at all! you probably need Ubuntu >= 20.04 (focal), sorry again.

so, in your case, you better off disabling CLAP support (cmake -DCONFIG_CLAP=OFF ...)

UPDATE: you may retry with qtractor >= 0.9.26.66git.fa24ef good luck!

suedwestlicht commented 2 years ago

Woohoo! 32975954c90fbe8be4ebba7c31a8b4a4ceb0efe5 builds nearly with qt 5.5.1. Only linking stops:

[  1%] Linking CXX executable qtractor
CMakeFiles/qtractor.dir/qtractorClapPlugin.cpp.o: In function `qtractorClapPlugin::Impl::get_extension(clap_host const*, char const*)':
qtractorClapPlugin.cpp:(.text+0x3f97): undefined reference to `qtractorClapPlugin::Impl::g_host_log'
qtractorClapPlugin.cpp:(.text+0x3fba): undefined reference to `qtractorClapPlugin::Impl::g_host_gui'
qtractorClapPlugin.cpp:(.text+0x3fdd): undefined reference to `qtractorClapPlugin::Impl::g_host_params'
qtractorClapPlugin.cpp:(.text+0x4000): undefined reference to `qtractorClapPlugin::Impl::g_host_audio_ports'
qtractorClapPlugin.cpp:(.text+0x4023): undefined reference to `qtractorClapPlugin::Impl::g_host_note_ports'
qtractorClapPlugin.cpp:(.text+0x4046): undefined reference to `qtractorClapPlugin::Impl::g_host_timer_support'
qtractorClapPlugin.cpp:(.text+0x4069): undefined reference to `qtractorClapPlugin::Impl::g_host_posix_fd_support'
qtractorClapPlugin.cpp:(.text+0x408c): undefined reference to `qtractorClapPlugin::Impl::g_host_thread_check'
qtractorClapPlugin.cpp:(.text+0x40ac): undefined reference to `qtractorClapPlugin::Impl::g_host_thread_pool'
qtractorClapPlugin.cpp:(.text+0x40cc): undefined reference to `qtractorClapPlugin::Impl::g_host_state'
qtractorClapPlugin.cpp:(.text+0x40ec): undefined reference to `qtractorClapPlugin::Impl::g_host_note_name'
collect2: error: ld returned 1 exit status
src/CMakeFiles/qtractor.dir/build.make:2372: recipe for target 'src/qtractor' failed
make[2]: *** [src/qtractor] Error 1
CMakeFiles/Makefile2:103: recipe for target 'src/CMakeFiles/qtractor.dir/all' failed
make[1]: *** [src/CMakeFiles/qtractor.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
rncbc commented 2 years ago

you rather don't even bother with the issue (btw, what is the compiler you're using? g++8 is the bare minimum for c++11 onwards...

if you insist in trying with CLAP, then I suggest and recommend you move to 20.04 (focal) as a minimum -- not even 18.04 (bionic) copes with this new thing (at least the u-he supplied beta previews, which I guess catched your interest in the first place) :)

suedwestlicht commented 2 years ago

I use gcc 5.4.

I don't insist in CLAP but saw in git log the promising line Refactored the CLAP plugin host clear method implementation to build on older systems (Qt < 5.7)

So I tried.

With disabled CLAP Qtractor builds just fine with gcc 5.4.

suedwestlicht commented 6 months ago

With gcc9 I could build it with CLAP support.