michaelforney / oscmix

Mixer for RME Fireface UCX II
Other
20 stars 4 forks source link

Problems with alsaseqio linking during build #3

Closed huddx01 closed 7 months ago

huddx01 commented 7 months ago

Hi Michael,

First, i would like to say, really great work! Seems to have the potential to support the capabilities of Totalmix on most of the RME units on linux.

I was able to build oscmix and alsarawio on a rpi v3.

But I have problems with alsaseqio.

Any hints?

Thanks in advance, meg

make
cc -std=c11 -O1   -c -o main.o main.c
cc -std=c11 -O1   -c -o osc.o osc.c
cc -std=c11 -O1   -c -o oscmix.o oscmix.c
cc -std=c11 -O1   -c -o socket.o socket.c
cc -std=c11 -O1   -c -o sysex.o sysex.c
cc -std=c11 -O1   -c -o util.o util.c
cc -std=c11  -o oscmix main.o osc.o oscmix.o socket.o sysex.o util.o -l pthread -l m
cc -std=c11 -O1   -c -o alsarawio.o alsarawio.c
cc -std=c11  -o alsarawio alsarawio.o
cc -std=c11  -O1 $(pkg-config --cflags alsa) -c -o alsaseqio.o alsaseqio.c
cc -std=c11  $(pkg-config --libs-only-L --libs-only-other alsa) -o alsaseqio alsaseqio.o $(pkg-config --libs-only-l alsa)
/usr/bin/ld: alsaseqio.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
make: *** [Makefile:66: alsaseqio] Fehler 1
michaelforney commented 7 months ago

Thanks for the report. The issue is that alsaseqio needs -l pthread. I didn't notice this since I typically use a linux system with musl libc, which has pthread built into libc. But I do have a continuous build set up for Debian, which didn't catch it either (maybe it was getting it from libasound?)

Anyway, this should be fixed now. Let me know if you encounter any other build issues.

huddx01 commented 7 months ago

Thanks, it works now. alsaseqio is compiled fine.

Anyhow, in the next step, it doesnt compile gtk.

libgtk-3-dev seems to be not installed .

apt install libgtk-3-dev gives me unresolved dependancies. But i think its on my own, as the raspi runs a total exotic and experimental debian based arml7 distro.

And I did not hear about gtk until now, but i assume i do not really need it, as its just a (graphical) gui? Or does it make sense to make the effort to get the gtk stuff compiled?

make
cc -std=c11 -O1   -c -o main.o main.c
cc -std=c11 -O1   -c -o osc.o osc.c
cc -std=c11 -O1   -c -o oscmix.o oscmix.c
cc -std=c11 -O1   -c -o socket.o socket.c
cc -std=c11 -O1   -c -o sysex.o sysex.c
cc -std=c11 -O1   -c -o util.o util.c
cc -std=c11  -o oscmix main.o osc.o oscmix.o socket.o sysex.o util.o -l pthread -l m
cc -std=c11 -O1   -c -o alsarawio.o alsarawio.c
cc -std=c11  -o alsarawio alsarawio.o
cc -std=c11  -O1 $(pkg-config --cflags alsa) -c -o alsaseqio.o alsaseqio.c
cc -std=c11  $(pkg-config --libs-only-L --libs-only-other alsa) -o alsaseqio alsaseqio.o $(pkg-config --libs-only-l alsa) -l pthread
make -C gtk
make[1]: Verzeichnis „/home/pi/oscmix/oscmix/gtk“ wird betreten
c99 -O1 -Wno-overlength-strings $(pkg-config --cflags --cflags gtk+-3.0)   -c -o main.o main.c
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
main.c:2:10: fatal error: gtk/gtk.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[1]: *** [<eingebaut>: main.o] Fehler 1
michaelforney commented 7 months ago

Yes, this error means you are missing the gtk3 development package. Your best bet is to search your operating system's package repository for the package name and install it. I'd expect libgtk-3-dev to work on a Debian-based system. It's only necessary if you want to use the gtk UI.

If you don't care about the gtk UI, you can build with make GTK=n or create a file config.mk containing GTK=n.

huddx01 commented 7 months ago

Ok, i installed libgtk-3-dev Version (3.24.24-4+rpt12+deb11u3).

Now:

make -C gtk
make[1]: Verzeichnis „/home/pi/oscmix/oscmix/gtk“ wird betreten
c99 -O1 -Wno-overlength-strings $(pkg-config --cflags --cflags gtk+-3.0)   -c -o main.o main.c
main.c: In function ‘main’:
main.c:666:34: error: ‘G_APPLICATION_DEFAULT_FLAGS’ undeclared (first use in this function); did you mean ‘G_APPLICATION_GET_CLASS’?
  666 |  app = gtk_application_new(NULL, G_APPLICATION_DEFAULT_FLAGS);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                  G_APPLICATION_GET_CLASS
main.c:666:34: note: each undeclared identifier is reported only once for each function it appears in

I also tried in line 666 | app = gtk_application_new(NULL, G_APPLICATION_FLAGS_NONE);

But this leaded to further errors.

michaelforney commented 7 months ago

Ugh, that's annoying. It seems that it might need a newer glib. I will investigate this later. For now, you can just disable gtk in config.mk.

huddx01 commented 7 months ago

sure, no problem. gtk is not really needed. just wanted to try out (and fix my apt stuff)