rustzx / rustzx

ZX Spectrum emulator written in Rust
MIT License
203 stars 19 forks source link

libjack related link error #21

Closed MagaTailor closed 8 years ago

MagaTailor commented 8 years ago

During the final link on an ARM Linux system, I'm getting this error even though I've got libjack installed:

note: ../rustzx/target/release/deps/libportaudio-cf78f0b5104b5853.rlib(pa_jack.o): In function `BuildDeviceList':
pa_jack.c:(.text+0x844): undefined reference to `jack_client_name_size'
pa_jack.c:(.text+0x868): undefined reference to `jack_client_name_size'
pa_jack.c:(.text+0x89c): undefined reference to `jack_get_ports'
pa_jack.c:(.text+0x9f4): undefined reference to `jack_client_name_size'
pa_jack.c:(.text+0xc0c): undefined reference to `jack_get_sample_rate'
pa_jack.c:(.text+0xe00): undefined reference to `jack_get_ports'
pa_jack.c:(.text+0xe58): undefined reference to `jack_port_by_name'
pa_jack.c:(.text+0xe64): undefined reference to `jack_port_get_latency'
pa_jack.c:(.text+0xef8): undefined reference to `jack_get_ports'
pa_jack.c:(.text+0xf50): undefined reference to `jack_port_by_name'
pa_jack.c:(.text+0xf5c): undefined reference to `jack_port_get_latency'

and so on. What are the required dependencies again? (static versions?)

pacmancoder commented 8 years ago

@petevine, thanks for the report! Hmmm, interesting. I not even tried to build it on ARM. My PortAudio grabs ALSA automatically, and it just works. Have you installed libportaudio2 and portaudio19-dev or portaudio was built during installation? Because I had some problems also, when dev package was not installed and portaudio crate compiling it manually. Or try to install jack dev package. Btw, what distribution are you using? If you will archive some success, tell me.

MagaTailor commented 8 years ago

I mentioned ARM cause I was expecting OpenGL issues - otherwise it doesn't matter, the Linux system is based on Ubuntu 14.04 and I made sure all dependencies were installed. Maybe I made a typo in a symlink or something (/usr/lib/arm-linux-gnueabihf/ path is sometimes not considered by the linker)

pacmancoder commented 8 years ago

Maybe there will be also some problems with OpenGL, but your log points to jack audio library. In first line we can see that rust crate portaudio tries to compile C-library, but can't find some Jack function definitions. So, if rust-portaudio tried to compile it, this means that it can't find system portaudio package with pkg-config utility.

MagaTailor commented 8 years ago

Let me repeat, this happened during the final link - the rust portaudio crate had compiled just fine earlier.

It would be better to get that failure at rust portaudio link time (by passing -ljack directly) instead of waiting until the very end.

MagaTailor commented 8 years ago

Following on that idea, I added -ljack to the final link command line and it managed to build this time.

Not sure why it was never a problem on your platform but modifying the build script along these lines is probably a good idea.