salsaman / LiVES

LiVES is a feature rich application which combines elements of VJ and video editing software. The current version runs on Linux / BSD. Check_out_the_new_discussion_area https://github.com/salsaman/LiVES/discussions
http://lives-video.com
GNU General Public License v3.0
89 stars 11 forks source link

build fails with undefined reference to `weed_layer_get_type' #40

Closed juanitotc closed 2 years ago

juanitotc commented 2 years ago

Building LiVES-3.2.0 using gcc-10.2 on an RPi4 fails with:

./autogen.sh

CC="gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe" CXX="g++ -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var 
$ make
...
libtool: link: gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fcommon -fPIE -Wstrict-aliasing=0 -Wall -pthread -I/usr/local/include/gtk-3.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/pango-1.0 -I/usr/local/include/harfbuzz -I/usr/local/include/pango-1.0 -I/usr/local/include/fribidi -I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/include/uuid -I/usr/local/include -DHAVE_WAYLAND=1 -DLIBAV_TRANSCODE=1 -DIS_LINUX_GNU=1 -DENABLE_OSC=1 -I/usr/local/include -DALSA_MIDI=1 -I/usr/local/include/libpng16 -DUSE_LIBPNG=1 -I/usr/local/include -I/usr/local/include -DUSE_SWSCALE=1 -D_REENTRANT -I/usr/local/include -DHAVE_PULSE_AUDIO=1 -DHAVE_PA_STREAM_BEGIN_WRITE=1 -DENABLE_GIW=1 -DNEED_LOCAL_WEED=1 -DNEED_LOCAL_WEED_UTILS=1 -DNEED_LOCAL_WEED_COMPAT=1 -DLIVES_LIBDIR=\"/usr/local/lib\" -DHAVE_WEBM=1 -DHAVE_LINUX_JOYSTICK_H=1 -DHAVE_PRCTL=1 -Wall -pthread -o .libs/lives-exe rpmalloc.o widget-helper.o main.o support.o effects.o lsd-tab.o plugins.o effects-weed.o effects-data.o framedraw.o interface.o paramspecial.o paramwindow.o rfx-builder.o preferences.o rte_window.o gui.o ce_thumbs.o htmsocket.o merge.o dialogs.o saveplay.o audio.o events.o resample.o osc.o omc-learn.o callbacks.o colourspace.o keyboard.o utils.o multitrack.o stream.o cvirtual.o startup.o pangotext.o machinestate.o weed-effects-utils.o diagnostics.o transcode.o pulse.o giw/giwknob.o giw/giwvslider.o giw/giwled.o giw/giwtimeline.o  -L/usr/local/lib -lgtk-3 -latk-1.0 -lgio-2.0 -lX11 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lgobject-2.0 ../libOSC/.libs/libOSC.a ../libOSC/client/.libs/libOSC_client.a -lasound -lpulse -lpng16 -lz -lswscale -lavutil /usr/src/LiVES-3.2.0/libweed/.libs/libweed_gslice.so -lglib-2.0 /usr/src/LiVES-3.2.0/libweed/.libs/libweed-utils.so -lm -ldl -pthread
/usr/local/bin/ld: colourspace.o: in function `weed_layer_is_video':
colourspace.c:(.text+0x12e64): undefined reference to `weed_layer_get_type'
/usr/local/bin/ld: colourspace.o: in function `weed_layer_is_audio':
colourspace.c:(.text+0x12eb0): undefined reference to `weed_layer_get_type'
/usr/local/bin/ld: colourspace.o: in function `weed_layer_pixel_data_free':
colourspace.c:(.text+0x1433c): undefined reference to `weed_layer_count_refs'
/usr/local/bin/ld: effects-weed.o: in function `wge_inner':
effects-weed.c:(.text+0x5db0): undefined reference to `get_next_compound_inst'
/usr/local/bin/ld: effects-weed.o: in function `add_param_connections':
effects-weed.c:(.text+0x7494): undefined reference to `get_next_compound_inst'
/usr/local/bin/ld: effects-weed.o: in function `weed_instance_from_filter':
effects-weed.c:(.text+0x7bdc): undefined reference to `get_next_compound_inst'
/usr/local/bin/ld: effects-weed.o: in function `num_in_params':
effects-weed.c:(.text+0x7ef0): undefined reference to `get_next_compound_inst'
/usr/local/bin/ld: effects-weed.o: in function `weed_reinit_effect':
effects-weed.c:(.text+0x9a28): undefined reference to `get_next_compound_inst'
/usr/local/bin/ld: effects-weed.o:effects-weed.c:(.text+0xc420): more undefined references to `get_next_compound_inst' follow
/usr/local/bin/ld: utils.o: in function `lives_alarm_set':
utils.c:(.text+0x2c14): undefined reference to `lives_alarm_reset'
/usr/local/bin/ld: utils.o: in function `d_print_overlay':
utils.c:(.text+0x4290): undefined reference to `lives_alarm_reset'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1058: lives-exe] Error 1
make[1]: Leaving directory '/usr/src/LiVES-3.2.0/src'
make: *** [Makefile:652: all-recursive] Error 1
Command exited with non-zero status 2
salsaman commented 2 years ago

Will check.

salsaman commented 2 years ago

Yes, I see the problem. The functions in question are lacking a prototype in the header files. At least one of them (weed_layer_get_type) is now in the header. I'll check the remaining ones. It seems like my compiler (gcc 9.3.0) ignores this, so it might be a new feature added in gcc 10.

salsaman commented 2 years ago

Yes in fact all of the functions referenced are now in header files. colourspace.h, effects-weed.h and alarms.h.

salsaman commented 2 years ago

If you want to patch it, just copy the function prototypes from the github version into the header files. 3.2.0 didn't have alarms.h, so that one can go in main.h if you like.

juanitotc commented 2 years ago

Thanks.

I now get:

In file included from widget-helper.c:9:
main.h:473:1: error: expected specifier-qualifier-list before 'typedef'
  473 | typedef int lives_alarm_t;

Does alarms.h need to go in a particular place in main.h?

juanitotc commented 2 years ago

Note also that I tried to compile the latest git, but:

main.c: In function 'lives_init':
main.c:2205:5: error: 'orig_err' undeclared (first use in this function)
salsaman commented 2 years ago

Somehow my comment got squished, so again:

The orig_error line should be surrounded by #ifdef ENABLE_JACK / #endif The typedef error is most probably because of a typo somewhere. You dont need to include all of alarms.h, just the one line in question.

juanitotc commented 2 years ago

I think it makes more sense for me to try and build from cloning the latest git, so I'll stop here with this thread.

salsaman commented 2 years ago

Fixed in git.