CasparCG / client

Client software primarily used with the CasparCG Server software for audio and video playout, to control graphics and recording, but it can also be used for other tasks within television broadcast.
https://casparcg.com
GNU General Public License v3.0
278 stars 97 forks source link

failed to link #273

Closed nerijus closed 7 months ago

nerijus commented 5 years ago

I am trying to build next branch on Fedora 30. Build command is:

BUILD_QT_PATH=/usr/lib64/qt5/bin BUILD_ARCHIVE_NAME=CasparCG-client BUILD_PARALLEL_THREADS=8 ./build-linux.sh

It fails to link:

g++ -m64 -Wl,-O1 -o shell Main.o Application.o qrc_Shell.o   -L/usr/X11R6/lib64 -L/a/CasparCG/client/src/Shell/../../lib/qatemcontrol/lib/linux/release/ -lqatemcontrol -L/a/CasparCG/client/src/Shell/../../lib/oscpack/lib/linux/ -loscpack -L/a/CasparCG/client/src/Shell/../../lib/boost/stage/lib/linux/ -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono -lvlc -lvlccore -L/a/CasparCG/client/src/Shell/../../lib/gpio-client/lib/linux/ -lgpio-client -L/a/CasparCG/client/build/Shell/../Atem/ -latem -L/a/CasparCG/client/build/Shell/../Caspar/ -lcaspar -L/a/CasparCG/client/build/Shell/../TriCaster/ -ltricaster -L/a/CasparCG/client/build/Shell/../Panasonic/ -lpanasonic -L/a/CasparCG/client/build/Shell/../Sony/ -lsony -L/a/CasparCG/client/build/Shell/../Spyder/ -lspyder -L/a/CasparCG/client/build/Shell/../Web/ -lweb -L/a/CasparCG/client/build/Shell/../Osc/ -losc -L/a/CasparCG/client/build/Shell/../Repository/ -lrepository -L/a/CasparCG/client/build/Shell/../Gpi/ -lgpi -L/a/CasparCG/client/build/Shell/../Common/ -lcommon -L/a/CasparCG/client/build/Shell/../Core/ -lcore -L/a/CasparCG/client/build/Shell/../Widgets/ -lwidgets -lQt5Widgets -lQt5Gui -lQt5Sql -lQt5Network -lQt5Core -lGL -lpthread 
/usr/bin/ld: /a/CasparCG/client/build/Shell/../Gpi//libgpi.so: undefined reference to `gpio::serial_port_device::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, boost::function<void (bool)> const&)'
/usr/bin/ld: /a/CasparCG/client/build/Shell/../Atem//libatem.so: undefined reference to `QAtemDownstreamKey::setOnAir(bool)'
/usr/bin/ld: /a/CasparCG/client/build/Shell/../Atem//libatem.so: undefined reference to `QAtemDownstreamKey::doAuto()'
/usr/bin/ld: /a/CasparCG/client/build/Shell/../Atem//libatem.so: undefined reference to `QAtemConnection::downstreamKey(unsigned char) const'
/usr/bin/ld: /a/CasparCG/client/build/Shell/../Atem//libatem.so: undefined reference to `QAtemDownstreamKey::setFrameRate(unsigned char)'
collect2: error: ld returned 1 exit status
Julusian commented 5 years ago

Have a look at some of the Pull Requests targetting the next branch. Some of them affect those libs it is having trouble linking, so merging them into your local tree may help you build it

nerijus commented 5 years ago

Unfortunately libgpio-client.so.1.0.0 from #262 requires boost 1.58, while next branch uses boost 1.57. Where is the source of libgpio-client.so, can I recompile it myself?

Julusian commented 5 years ago

I'm not sure if its the latest, but there is a copy at https://github.com/CasparCG/Tools/tree/master/cpp/gpio/trunk

nerijus commented 5 years ago

Thanks, recompiled it, got libqatemcontrol.so.1.0.0 from #259 and it links now.

nerijus commented 5 years ago

Sorry, I missed that #256 exists for the next branch (it links now too with it). But client segfaults at startup:

free(): invalid pointer
[2019-02-25 10:41:20.748] [7ffff1b93800] [W] libpng warning: iCCP: known incorrect sRGB profile

Thread 8 "shell" received signal SIGABRT, Aborted.
(gdb) bt
#0  0x00007ffff47f20f5 in raise () at /lib64/libc.so.6
#1  0x00007ffff47dc895 in abort () at /lib64/libc.so.6
#2  0x00007ffff4835347 in __libc_message () at /lib64/libc.so.6
#3  0x00007ffff483bbfc in  () at /lib64/libc.so.6
#4  0x00007ffff483d36c in _int_free () at /lib64/libc.so.6
#5  0x00007ffff7110845 in boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >::~clone_impl() () at /a/CasparCG/client/lib/boost/stage/lib/linux/libboost_chrono.so.1.57.0
#6  0x00007ffff4b887a3 in  () at /lib64/libstdc++.so.6
#7  0x00007ffff6d56be6 in gpio::serial_port_device::impl::connect()0x1535830) at ../../gpio-client/src/serial_port_device.cpp:423
#8  0x00007ffff6d859d9 in boost::_mfi::mf0<void, gpio::serial_port_device::impl>::operator()(gpio::serial_port_device::impl*) const0x1535830) at ../../dependencies/boost/boost/bind/mem_fn_template.hpp:49
#9  0x00007ffff6d84172 in boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> >::operator()<boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, gpio::serial_port_device::impl>&, boost::_bi::list0&, int)0x7f
   ...) at ../../dependencies/boost/boost/bind/bind.hpp:253
#10 0x00007ffff6d81810 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > >::operator()()0x7fffce40bb20) at ../../dependencies/boost/boost/bind/bind_template.hpp:20
#11 0x00007ffff6d8380e in boost::asio::asio_handler_invoke<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > >&, ...)...) at ../../dependencies/boost/boost/asio/handler_invoke_hook.hpp:69
#12 0x00007ffff6d80fb2 in boost_asio_handler_invoke_helpers::invoke<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > >, boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > >&, boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > >&)...) at ../../dependencies/boost/boost/asio/detail/handler_invoke_helpers.hpp:37
#13 0x00007ffff6d7b80e in boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long)0x15cf850) at ../../dependencies/boost/boost/asio/detail/completion_handler.hpp:68
#14 0x00007ffff6d4b0bc in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long)0) at ../../dependencies/boost/boost/asio/detail/task_io_service_opera
   tion.hpp:38
#15 0x00007ffff6d4dea3 in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&)...) at ../../depen
   dencies/boost/boost/asio/detail/impl/task_io_service.ipp:372
#16 0x00007ffff6d4d8c7 in boost::asio::detail::task_io_service::run(boost::system::error_code&)...) at ../../dependencies/boost/boost/asio/detail/impl/task_io_service.ipp:149
#17 0x00007ffff6d4e162 in boost::asio::io_service::run()0x1535830) at ../../dependencies/boost/boost/asio/impl/io_service.ipp:59
#18 0x00007ffff6d5713a in gpio::serial_port_device::impl::run()0x1535830) at ../../gpio-client/src/serial_port_device.cpp:515
#19 0x00007ffff6d859d9 in boost::_mfi::mf0<void, gpio::serial_port_device::impl>::operator()(gpio::serial_port_device::impl*) const0x1535830) at ../../dependencies/boost/boost/bind/mem_fn_template.hpp:49
#20 0x00007ffff6d84172 in boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> >::operator()<boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, gpio::serial_port_device::impl>&, boost::_bi::list0&, int)0x1657558
   ...) at ../../dependencies/boost/boost/bind/bind.hpp:253
#21 0x00007ffff6d81810 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > >::operator()()0x1657548) at ../../dependencies/boost/boost/bind/bind_template.hpp:20
#22 0x00007ffff6d8a006 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gpio::serial_port_device::impl>, boost::_bi::list1<boost::_bi::value<gpio::serial_port_device::impl*> > > >::run()0x1657390) at ../../dependencies/boost/boost/thread/detail/thread.hpp:116
#23 0x00007ffff753d42a in thread_proxy () at /a/CasparCG/client/lib/boost/stage/lib/linux/libboost_thread.so.1.57.0
#24 0x00007ffff4cde5a2 in start_thread () at /lib64/libpthread.so.0
#25 0x00007ffff48b55c3 in clone () at /lib64/libc.so.6
nerijus commented 5 years ago

If I use my own compiled libgpio-client.so.1.0.0, it segfaults with another backtrace:

Thread 1 "shell" received signal SIGSEGV, Segmentation fault.
(gdb) bt
#0  0x00007ffff774ede2 in boost::system::error_category::equivalent(boost::system::error_code const&, int) const () at /a/CasparCG/client/lib/boost/stage/lib/linux/libboost_system.so.1.57.0
#1  0x00007ffff6f9b9ef in boost::asio::detail::posix_mutex::posix_mutex() () at bin/libgpio-client.so.1
#2  0x00007ffff6fa541c in gpio::serial_port_device::impl::impl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, boost::function<void (bool)> const&) () at bin/libgpio-client.so.1
#3  0x00007ffff6f80070 in gpio::serial_port_device::serial_port_device(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, boost::function<void (bool)> const&) () at bin/libgpio-client.so.1
#4  0x00007ffff6f800c3 in gpio::serial_port_device::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, boost::function<void (bool)> const&) () at bin/libgpio-client.so.1
#5  0x00007ffff6eb08a6 in GpiDevice::GpiDevice(QString const&, int) () at bin/libgpi.so.1
#6  0x00007ffff6daf393 in GpiManager::initialize() () at bin/libcore.so.1
#7  0x0000000000408328 in main ()
nerijus commented 5 years ago

Recompiled with system libs (by adding CONFIG += system-libqatemcontrol, CONFIG += system-boost, CONFIG += system-gpio-client, CONFIG += system-libvlc to *.pro files) and now it does not segfault anymore.

nerijus commented 5 years ago

BTW, where is the "CasparCG Client 2.2.0 RC 1.zip" source code? It displays version 2.2.0 and Database revision 214, while my own compiled version from the next branch displays version 2.0.9 and Database revision 213.

muxlux commented 4 years ago

@nerijus, glad to hear it's working for you, is CONFIG += system-libqatemcontrol supposed to replace CONFIG += c++11 in Atem.pro and so on with other .pro files?

nerijus commented 4 years ago

I left the line CONFIG += c++11 where it is and just added other lines. My diff is:

diff --git a/src/Atem/Atem.pro b/src/Atem/Atem.pro
index 7a27f8b6..90a88055 100644
--- a/src/Atem/Atem.pro
+++ b/src/Atem/Atem.pro
@@ -15,6 +15,8 @@ HEADERS += \
 SOURCES += \
     AtemDevice.cpp \
     SwitcherDevice.cpp
+
+CONFIG += system-libqatemcontrol

 CONFIG(system-libqatemcontrol) {
     LIBS += -lqatemcontrol
diff --git a/src/Core/Core.pro b/src/Core/Core.pro
index 1bcacfe7..13a28ae9 100644
--- a/src/Core/Core.pro
+++ b/src/Core/Core.pro
@@ -413,6 +413,8 @@ else:macx:LIBS += -L$$PWD/../../lib/oscpack/lib/macx/ -loscpack
 else:unix:LIBS += -L$$PWD/../../lib/oscpack/lib/linux/ -loscpack
 }

+CONFIG += system-boost
+
 CONFIG(system-boost) {
 LIBS += -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 } else {
@@ -423,6 +425,8 @@ else:macx:LIBS += -L$$PWD/../../lib/boost/stage/lib/macx/ -lboost_date_time -lbo
 else:unix:LIBS += -L$$PWD/../../lib/boost/stage/lib/linux/ -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 }

+CONFIG += system-gpio-client
+
 CONFIG(system-gpio-client) {
 LIBS += -lgpio-client
 } else {
diff --git a/src/Gpi/Gpi.pro b/src/Gpi/Gpi.pro
index d1195c4f..dc921cb7 100644
--- a/src/Gpi/Gpi.pro
+++ b/src/Gpi/Gpi.pro
@@ -14,6 +14,9 @@ HEADERS += \
 SOURCES += \
     GpiDevice.cpp

+
+CONFIG += system-boost
+
 CONFIG(system-boost) {
     LIBS += -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 } else {
@@ -24,6 +27,8 @@ CONFIG(system-boost) {
     else:unix:LIBS += -L$$PWD/../../lib/boost/stage/lib/linux/ -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 }

+CONFIG += system-gpio-client
+
 CONFIG(system-gpio-client) {
     LIBS += -lgpio-client
 } else {
diff --git a/src/Osc/Osc.pro b/src/Osc/Osc.pro
index 66fa22df..9b0006d5 100644
--- a/src/Osc/Osc.pro
+++ b/src/Osc/Osc.pro
@@ -20,6 +20,8 @@ SOURCES += \
     OscSender.cpp \
     OscWebSocketListener.cpp

+CONFIG += system-boost
+
 CONFIG(system-boost) {
     LIBS += -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 } else {
diff --git a/src/Shell/Shell.pro b/src/Shell/Shell.pro
index 94019a7a..0625bad6 100755
--- a/src/Shell/Shell.pro
+++ b/src/Shell/Shell.pro
@@ -64,6 +64,8 @@ CONFIG(system-oscpack) {
     else:unix:LIBS += -L$$PWD/../../lib/oscpack/lib/linux/ -loscpack
 }

+CONFIG += system-boost
+
 CONFIG(system-boost) {
     LIBS += -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 } else {
@@ -74,6 +76,8 @@ CONFIG(system-boost) {
     else:unix:LIBS += -L$$PWD/../../lib/boost/stage/lib/linux/ -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 }

+CONFIG += system-libvlc
+
 CONFIG(system-libvlc) {
     LIBS += -lvlc -lvlccore
 } else {
diff --git a/src/Widgets/Widgets.pro b/src/Widgets/Widgets.pro
index 976143ee..26c15a2d 100644
--- a/src/Widgets/Widgets.pro
+++ b/src/Widgets/Widgets.pro
@@ -772,6 +772,8 @@ CONFIG(system-oscpack) {
     else:unix:LIBS += -L$$PWD/../../lib/oscpack/lib/linux/ -loscpack
 }

+CONFIG += system-boost
+
 CONFIG(system-boost) {
     LIBS += -lboost_date_time -lboost_system -lboost_thread -lboost_filesystem -lboost_chrono
 } else {
muxlux commented 4 years ago

i'm using https://github.com/Zebiolo/client/tree/next-fix/upgrade-libqatemcontrol-linux with diff edits & i just keep getting: /// In file included from ../../src/Gpi/GpiDevice.cpp:1:0: ../../src/Gpi/GpiDevice.h:7:10: fatal error: gpio/serial_port_device.h: No such file or directory

include <gpio/serial_port_device.h>

      ^~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated. /// but serial_port_device.h is in gpio/

Julusian commented 7 months ago

The build process has been reworked so this no longer applies