nukeykt / Nuked-SC55

Roland SC-55 series emulation
Other
286 stars 33 forks source link

Fix `cmake build` issue on Raspbian #26

Closed work-william-au closed 3 months ago

work-william-au commented 3 months ago

Hi, I have been successfully built and installed the emulator onto my Raspbian. However, it needs a minor fix in order to make the cmake build works. The emulator could start on my Raspberry Pi 3, but I feel my Pi 3 is too slow for the emulation. Actual functionalities are not tested.

Symptom

$ cmake --build .
/usr/bin/ld: libRtMidi.a(RtMidi.cpp.o): undefined reference to symbol 'pthread_create@@GLIBC_2.4'
/usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/nuked-sc55.dir/build.make:225: nuked-sc55] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/nuked-sc55.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2

Platform

$ lsb_release -a
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:    11
Codename:   bullseye

Solution

Add the following line to the CMakeLists.txt and it compiles successfully.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")