Git Product home page Git Product logo

Comments (5)

NilsBrause avatar NilsBrause commented on June 20, 2024

Please remove "-Wl,--no-undefined" from your custom link flags.
These undefined references aren't a problem, because a program using waylandpp will be linking against wayland-client++ anyway.

from waylandpp.

olafhering avatar olafhering commented on June 20, 2024

This comes from the global rpm %cmake macro:

...
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\
        -DCMAKE_C_FLAGS="${CFLAGS:-%optflags} -DNDEBUG" \\\
        -DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG" \\\
        -DCMAKE_Fortran_FLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}} -DNDEBUG" \\\
        -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
        -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \\\
        -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
...

from waylandpp.

NilsBrause avatar NilsBrause commented on June 20, 2024

Does f478bb7 fix it for you?

from waylandpp.

olafhering avatar olafhering commented on June 20, 2024

Yes, thanks.

from waylandpp.

meltdown03 avatar meltdown03 commented on June 20, 2024

I still have build issues even with the newest commits (7c72bbd). I can, however, build Kodi from source on Archlinux if I downgrade waylandpp to version 0.2.5. Here is the CMakeError.log file:

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_f7da0/fast && /usr/bin/make -f CMakeFiles/cmTC_f7da0.dir/build.make CMakeFiles/cmTC_f7da0.dir/build
make[1]: Entering directory '/home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f7da0.dir/src.c.o
/usr/lib/ccache/bin/cc   -march=native -O2 -pipe -fstack-protector-strong -fno-plt -DWL_EGL_PLATFORM=1 -DPLATFORM_SETTINGS_FILE=wayland.xml -Wall -DCMAKE_HAVE_LIBC_PTHREAD   -o CMakeFiles/cmTC_f7da0.dir/src.c.o   -c /home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_f7da0
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f7da0.dir/link.txt --verbose=1
/usr/lib/ccache/bin/cc -march=native -O2 -pipe -fstack-protector-strong -fno-plt -DWL_EGL_PLATFORM=1 -DPLATFORM_SETTINGS_FILE=wayland.xml -Wall -DCMAKE_HAVE_LIBC_PTHREAD  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fuse-ld=gold  CMakeFiles/cmTC_f7da0.dir/src.c.o  -o cmTC_f7da0 
CMakeFiles/cmTC_f7da0.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_create'
CMakeFiles/cmTC_f7da0.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_detach'
CMakeFiles/cmTC_f7da0.dir/src.c.o:src.c:function main: error: undefined reference to 'pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_f7da0.dir/build.make:87: cmTC_f7da0] Error 1
make[1]: Leaving directory '/home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_f7da0/fast] Error 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_c1eb5/fast && /usr/bin/make -f CMakeFiles/cmTC_c1eb5.dir/build.make CMakeFiles/cmTC_c1eb5.dir/build
make[1]: Entering directory '/home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c1eb5.dir/CheckFunctionExists.c.o
/usr/lib/ccache/bin/cc   -march=native -O2 -pipe -fstack-protector-strong -fno-plt -DWL_EGL_PLATFORM=1 -DPLATFORM_SETTINGS_FILE=wayland.xml -Wall -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_c1eb5.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.15/Modules/CheckFunctionExists.c
Linking C executable cmTC_c1eb5
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c1eb5.dir/link.txt --verbose=1
/usr/lib/ccache/bin/cc -march=native -O2 -pipe -fstack-protector-strong -fno-plt -DWL_EGL_PLATFORM=1 -DPLATFORM_SETTINGS_FILE=wayland.xml -Wall -DCHECK_FUNCTION_EXISTS=pthread_create  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fuse-ld=gold  CMakeFiles/cmTC_c1eb5.dir/CheckFunctionExists.c.o  -o cmTC_c1eb5 -lpthreads 
/usr/bin/ld.gold: error: cannot find -lpthreads
CMakeFiles/cmTC_c1eb5.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_c1eb5.dir/build.make:87: cmTC_c1eb5] Error 1
make[1]: Leaving directory '/home/neal/git/kodi-git/src/xbmc/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_c1eb5/fast] Error 2

from waylandpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.