sarah-walker-pcem / pcem

PCem
http://pcem-emulator.co.uk
GNU General Public License v2.0
1.55k stars 216 forks source link

Build process is broken when using -DUSE_ALSA=ON in libpcem.so #96

Closed FredBezies closed 2 years ago

FredBezies commented 2 years ago

Describe the bug I wanted to build git code with these options on my Archlinux:

-DUSE_NETWORKING=ON -DUSE_ALSA=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .

To Reproduce Steps to reproduce the behavior:

  1. Grad latest git commit
  2. Use these CMAKE options: -DUSE_NETWORKING=ON -DUSE_ALSA=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .
  3. Launch build process
  4. Wait

Here is the error log I got:

[347/347] Linking C executable src/pcem
FAILED: src/pcem 
: && /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O3 -DNDEBUG -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now src/CMakeFiles/pcem-bin.dir/main.c.o -o src/pcem  -Wl,-rpath,/home/fred/pcem-git/src/pcem/src:  src/libpcem.so  -pthread  -lwx_gtk2u_core-3.0  -lwx_baseu-3.0  -lwx_gtk2u_xrc-3.0  /usr/lib/libSDL2main.a  /usr/lib/libSDL2-2.0.so.0.18.2  /usr/lib/libopenal.so  /usr/lib/libOpenGL.so  /usr/lib/libGLX.so  /usr/lib/libGLU.so  /usr/lib/libpcap.so && :
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_ctl_rawmidi_info'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_ctl_open'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_info_get_subdevices_count'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_info_set_stream'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_info_set_device'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_open'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_info_set_subdevice'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_card_get_name'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_card_next'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_ctl_rawmidi_next_device'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_close'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_info_sizeof'
/usr/bin/ld: src/libpcem.so: undefined reference to `snd_rawmidi_write'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().

Expected behavior Linking worked and getting a working pcem executable.

michael-manley commented 2 years ago

It was missing the libraries line to add ASound to the libraries. It will be fixed in the latest commit.

FredBezies commented 2 years ago

Fixed. Thanks!