smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
619 stars 156 forks source link

cannot compile the Exemple #64

Closed ROBERT-MCDOWELL closed 5 years ago

ROBERT-MCDOWELL commented 5 years ago

Determining if the pthread_create exist failed with the following output: Change Dir: /home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_eb3eb/fast" /usr/bin/gmake -f CMakeFiles/cmTC_eb3eb.dir/build.make CMakeFiles/cmTC_eb3eb.dir/build gmake[1]: Entering directory '/home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_eb3eb.dir/CheckSymbolExists.c.o /usr/lib64/ccache/cc -o CMakeFiles/cmTC_eb3eb.dir/CheckSymbolExists.c.o -c /home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp/CheckSymbolExists.c Linking C executable cmTC_eb3eb /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_eb3eb.dir/link.txt --verbose=1 /usr/lib64/ccache/cc -rdynamic CMakeFiles/cmTC_eb3eb.dir/CheckSymbolExists.c.o -o cmTC_eb3eb CMakeFiles/cmTC_eb3eb.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference topthread_create' collect2: error: ld returned 1 exit status gmake[1]: [CMakeFiles/cmTC_eb3eb.dir/build.make:87: cmTC_eb3eb] Error 1 gmake[1]: Leaving directory '/home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp' gmake: [Makefile:126: cmTC_eb3eb/fast] Error 2

File /home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include

int main(int argc, char** argv) { (void)argv;

ifndef pthread_create

return ((int*)(&pthread_create))[argc];

else

(void)argc; return 0;

endif

}

Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_4dd6c/fast" /usr/bin/gmake -f CMakeFiles/cmTC_4dd6c.dir/build.make CMakeFiles/cmTC_4dd6c.dir/build gmake[1]: Entering directory '/home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_4dd6c.dir/CheckFunctionExists.c.o /usr/lib64/ccache/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_4dd6c.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c Linking C executable cmTC_4dd6c /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4dd6c.dir/link.txt --verbose=1 /usr/lib64/ccache/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_4dd6c.dir/CheckFunctionExists.c.o -o cmTC_4dd6c -lpthreads /usr/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status gmake[1]: [CMakeFiles/cmTC_4dd6c.dir/build.make:87: cmTC_4dd6c] Error 1 gmake[1]: Leaving directory '/home/src/screen_capture_lite/Example/CMakeFiles/CMakeTmp' gmake: [Makefile:126: cmTC_4dd6c/fast] Error 2

libpthread is installed on my system (Fedora 27 64bit /usr/lib/libpthread-2.26.so /usr/lib/libpthread.so /usr/lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a /usr/lib/debug/lib64/libpthread-2.20.so.debug /usr/lib/debug/lib64/libpthread.so.0.debug /usr/lib/debug/usr/lib64/libpthread.a /usr/lib/debug/usr/lib64/libpthread_nonshared.a /usr/lib/i686/nosegneg/libpthread-2.26.so /usr/lib/i686/nosegneg/libpthread.so.0 /usr/lib64/libpthread-2.26.so /usr/lib64/libpthread.a /usr/lib64/libpthread.so /usr/lib64/libpthread.so.0 /usr/lib64/libpthread_nonshared.a

it is possible to send you a PM? I would like to make you a proposition thanks

smasherprog commented 5 years ago

my email is on my github profile.

smasherprog commented 5 years ago

You need to add pthread. You can see my cmake for the example, this contains the libraries youd need https://github.com/smasherprog/screen_capture_lite/blob/master/Example/CMakeLists.txt

ROBERT-MCDOWELL commented 5 years ago

but the list I provided shows libpthread installed no? /usr/lib64/libpthread* -rwxr-xr-x 1 root root 149360 Aug 29 10:19 /usr/lib64/libpthread-2.26.so -rw-r--r-- 1 root root 160520 Aug 29 10:19 /usr/lib64/libpthread.a -rw-r--r-- 1 root root 1732 Aug 29 10:19 /usr/lib64/libpthread_nonshared.a -rw-r--r-- 1 root root 222 Aug 29 10:17 /usr/lib64/libpthread.so lrwxrwxrwx 1 root root 18 Aug 29 10:17 /usr/lib64/libpthread.so.0 -> libpthread-2.26.so

smasherprog commented 5 years ago

I dont use fedora so i dont know. pthread is not being found though.

smasherprog commented 5 years ago

Closing due to lack of activity