You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many usages of lock_guard in LMMS (specifically in ZynAddSubFx plugin AFAIK), that fail to compile under GCC 12 (C++ 12).
The current usage is like this:
const auto lock = std::lock_guard{m_master->mutex};
which can be resolved (maybe stupidly) by changing it to:
according to lock_guard, which raises syntax error "no instance of constructor "std::lock_guard<_Mutex>::lock_guard [with _Mutex=std::mutex]" matches the argument listC/C++(289)".
Which, after making the change, gives the same error you see in the logs (std::lock_guard<pthread_mutex_t>::mutex_type’ {aka ‘union pthread_mutex_t’} has no member named ‘lock’).
Sorry for my rusty C++ and I have no idea what the curly braces after lock do, but it seems to be OK with the linter.
Is LMMS supposed to be built with an old compiler or does the mutex code need to be re-written?
Steps to reproduce
Make folder build and move to it. Then run cmake .. followed by cmake -j $(nproc)
Expected behavior
Successful build
Actual behavior
Fails at around 95% of build around building the plugin ZynAddSubFx. Error is the following:
Screenshot
Screenshot from VSCode 1.76.1 on Fedora 37.
Affected LMMS versions
Latest master branch
Logs
Click to expand
#Here's the build log. The error part with some pre-error build log is included only
[ 92%] Built target pitch_scale_1194
[ 92%] Built target sc1_1425
[ 92%] Built target pitch_scale_1193
[ 92%] Built target sc2_1426
[ 93%] Built target sc4_1882
[ 93%] Built target sc3_1427
[ 93%] Built target sc4m_1916
[ 93%] Built target se4_1883
[ 94%] Built target vstbase
[ 94%] Built target lmms
[ 94%] Built target vsteffect
[ 94%] Built target vestige
In file included from /usr/include/c++/12/mutex:43,
from /home/mehdi/src/lmms/plugins/ZynAddSubFx/zynaddsubfx/src/Misc/Util.h:27,
from /home/mehdi/src/lmms/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp:43:
/usr/include/c++/12/bits/std_mutex.h: In instantiation of ‘std::lock_guard<_Mutex>::lock_guard(mutex_type&) [with _Mutex = pthread_mutex_t; mutex_type = pthread_mutex_t]’:
/home/mehdi/src/lmms/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp:145:52: required from here
/usr/include/c++/12/bits/std_mutex.h:229:19: error: ‘std::lock_guard::mutex_type’ {aka ‘union pthread_mutex_t’} has no member named ‘lock’
229 | { _M_device.lock(); }
| ~~~~~~~~~~^~~~
/usr/include/c++/12/bits/std_mutex.h: In instantiation of ‘std::lock_guard<_Mutex>::~lock_guard() [with _Mutex = pthread_mutex_t]’:
/home/mehdi/src/lmms/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp:145:52: required from here
/usr/include/c++/12/bits/std_mutex.h:235:19: error: ‘std::lock_guard::mutex_type’ {aka ‘union pthread_mutex_t’} has no member named ‘unlock’
235 | { _M_device.unlock(); }
| ~~~~~~~~~~^~~~~~
make[2]: *** [plugins/ZynAddSubFx/CMakeFiles/ZynAddSubFxCoreObjs.dir/build.make:76: plugins/ZynAddSubFx/CMakeFiles/ZynAddSubFxCoreObjs.dir/LocalZynAddSubFx.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6873: plugins/ZynAddSubFx/CMakeFiles/ZynAddSubFxCoreObjs.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
The text was updated successfully, but these errors were encountered:
Bug Summary
There are many usages of lock_guard in LMMS (specifically in ZynAddSubFx plugin AFAIK), that fail to compile under GCC 12 (C++ 12).
The current usage is like this:
which can be resolved (maybe stupidly) by changing it to:
but, it should probably be like:
according to lock_guard, which raises syntax error "no instance of constructor "std::lock_guard<_Mutex>::lock_guard [with _Mutex=std::mutex]" matches the argument listC/C++(289)".
Looks like the correct way is:
Which, after making the change, gives the same error you see in the logs (std::lock_guard<pthread_mutex_t>::mutex_type’ {aka ‘union pthread_mutex_t’} has no member named ‘lock’).
Sorry for my rusty C++ and I have no idea what the curly braces after lock do, but it seems to be OK with the linter.
Is LMMS supposed to be built with an old compiler or does the mutex code need to be re-written?
Steps to reproduce
Make folder
build
and move to it. Then runcmake ..
followed bycmake -j $(nproc)
Expected behavior
Successful build
Actual behavior
Fails at around 95% of build around building the plugin
ZynAddSubFx
. Error is the following:Screenshot
Screenshot from VSCode 1.76.1 on Fedora 37.
Affected LMMS versions
Latest master branch
Logs
Click to expand
The text was updated successfully, but these errors were encountered: