I am not able to configure cmake.
The issue is as described below about I am unable to make most of it:
CMake error at /snap/cmake/936/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake230 (message):Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
Call Stack (most recent call first):
/snap/cmake/936/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake594 (_FPHSA_FAILURE_MESSAGE)
/snap/cmake/936/share/cmake-3.21/Modules/FindXII.camke:457 (find_package_handle_Standard_args)
extern/glfx/CMakeLists.txt:27 (find package)
Below is the error log (CmakeErrorLog):
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_81640/fast && /usr/bin/make -f CMakeFiles/cmTC_81640.dir/build.make CMakeFiles/cmTC_81640.dir/build
make[1]: Entering directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_81640.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_81640.dir/src.c.o -c /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_81640
/snap/cmake/936/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81640.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_81640.dir/src.c.o -o cmTC_81640
/usr/bin/ld: CMakeFiles/cmTC_81640.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x5e): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x6f): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_81640.dir/build.make:99: cmTC_81640] Error 1
make[1]: Leaving directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_81640/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(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/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_f6423/fast && /usr/bin/make -f CMakeFiles/cmTC_f6423.dir/build.make CMakeFiles/cmTC_f6423.dir/build
make[1]: Entering directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o -c /snap/cmake/936/share/cmake-3.21/Modules/CheckFunctionExists.c
Linking C executable cmTC_f6423
/snap/cmake/936/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f6423.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o -o cmTC_f6423 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_f6423.dir/build.make:99: cmTC_f6423] Error 1
make[1]: Leaving directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_f6423/fast] Error 2
The output log is too big and I cannot post it (maybe can post parts of it).
I am positive that I have all needed libraries installed. The issue must lie with the cmake implementation.
What is did is the following
Basically I was at the CMake master file and I wanted to run it at the testbed folder of box2d.
Can anyone help me out please?
If more information is needed let me know
Eventually was able to configure cmake without error
Initially the problem was because the following library was not installed: x11-dev
Then another error came up, as noted in the above comment.
After installing the following xorg-dev libglu1-mesa-dev the configuration was completed without any errors.
Thank you both for the help!
Related
I'm trying to install plexe-sumo with cmake. I followed the tutorial at plexe.car2x.org and here's the results:
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_BINARY_DIR: /home/cc/src/plexe-sumo/build-release
-- CMAKE_SOURCE_DIR: /home/cc/src/plexe-sumo
--
-- Platform:
-- Host: Linux4.15.0-34-genericx86_64
-- CMake: 3.12.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
--
-- Found Proj: /usr/lib/x86_64-linux-gnu/libproj.so
CMake Error at /usr/local/share/cmake-3.12/Modules/UseSWIG.cmake:627 (add_custom_target):
add_custom_target cannot create target "libsumo_swig_compilation" because
another target with the same name already exists. The existing target is a
custom target created in source directory
"/home/cc/src/plexe-sumo/src/libsumo". See documentation for policy
CMP0002 for more details.
Call Stack (most recent call first):
src/libsumo/CMakeLists.txt:39 (SWIG_ADD_LIBRARY)
-- Enabled features: Linux-4.15.0-34-generic Proj GUI GDAL OSG GL2PS SWIG
-- Configuring incomplete, errors occurred!
There is no file named 'libsumo_swig_compilation' under "/home/cc/src/plexe-sumo/src/libsumo".
Then I checked the error log file, but the errors shown are about pthread saying 'undefined reference to pthread_creat' and 'cannot find -lpthreads'. Actually my pthread library is installed at 'libc6: /lib/x86_64-linux-gnu/libpthread.so.0'.
So I was wondering what's the exact problem here and how to solve it. I'm using a virtual machine with ubuntu 16. I appreciate your help!
Following is the error log file:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_050d5/fast"
/usr/bin/make -f CMakeFiles/cmTC_050d5.dir/build.make CMakeFiles/cmTC_050d5.dir/build
make[1]: Entering directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o
/usr/bin/cc -Wall -pedantic -Wextra -o CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o -c /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function ‘main’:
/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
return ((int*)(&pthread_create))[argc];
^
Linking C executable cmTC_050d5
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_050d5.dir/link.txt --verbose=1
/usr/bin/cc -Wall -pedantic -Wextra -rdynamic CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o -o cmTC_050d5
CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_050d5.dir/build.make:86: recipe for target 'cmTC_050d5' failed
make[1]: *** [cmTC_050d5] Error 1
make[1]: Leaving directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_050d5/fast' failed
make: *** [cmTC_050d5/fast] Error 2
File /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
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/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_9f654/fast"
/usr/bin/make -f CMakeFiles/cmTC_9f654.dir/build.make CMakeFiles/cmTC_9f654.dir/build
make[1]: Entering directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o
/usr/bin/cc -Wall -pedantic -Wextra -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.12/Modules/CheckFunctionExists.c
Linking C executable cmTC_9f654
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9f654.dir/link.txt --verbose=1
/usr/bin/cc -Wall -pedantic -Wextra -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o -o cmTC_9f654 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_9f654.dir/build.make:86: recipe for target 'cmTC_9f654' failed
make[1]: *** [cmTC_9f654] Error 1
make[1]: Leaving directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_9f654/fast' failed
make: *** [cmTC_9f654/fast] Error 2
My assumption is that this is really a behavior which only the new cmake shows. You could try to rename all references to libsumo in the java part of the CMakeLists.txt or simply use the CMakeLists of the main line sumo here: https://github.com/eclipse/sumo/blob/master/src/libsumo/CMakeLists.txt
I cant get working my blas library with cmake. I have arch-linxux, both blas and cmake are installed with pacman. Cant understand where is problem :-(. I made cmake to print out the output of macro CHECK_FORTRAN_FUNCTION_EXISTS, because it fails there. Maybe I dont have proper configuration of ld?
My simple testing CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(Test C Fortran)
find_package(BLAS)
Error part from output:
-- Looking for Fortran sgemm
-- Change Dir: /home/jiri/test_lapack/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_486fc/fast"
/usr/bin/make -f CMakeFiles/cmTC_486fc.dir/build.make CMakeFiles/cmTC_486fc.dir/build
make[1]: Entering directory '/home/jiri/test_lapack/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_486fc.dir/testFortranCompiler.f.o
/usr/bin/gfortran -c /home/jiri/test_lapack/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_486fc.dir/testFortranCompiler.f.o
Linking Fortran executable cmTC_486fc
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_486fc.dir/link.txt --verbose=1
/usr/bin/gfortran CMakeFiles/cmTC_486fc.dir/testFortranCompiler.f.o -o cmTC_486fc /usr/local/lib64/libblas.a
/usr/bin/ld: /usr/local/lib64/libblas.a(sgemm.f.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib64/libblas.a(xerbla.f.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_486fc.dir/build.make:99: cmTC_486fc] Error 1
make[1]: Leaving directory '/home/jiri/test_lapack/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_486fc/fast] Error 2
-- Looking for Fortran sgemm - not found
So I was trying to install libssh base on instruction from https://github.com/substack/libssh/blob/master/INSTALL
Then when I was trying to build using cmake I have run into problems. I have cmake module on my linux server "cmake/3.7.2-1"
When I have executed command
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
I got following errors:
CMake Error at /afs/.../RHEL6-x86_64/cmake/3.7.2-1/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message):
The C++ compiler ".../4.9.1/Linux_x86_64_compiled/bin/gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_e97bb/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_e97bb.dir/build.make
CMakeFiles/cmTC_e97bb.dir/build
gmake[1]: Entering directory
`/local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e97bb.dir/testCXXCompiler.cxx.o
/.../4.9.1/Linux_x86_64_compiled/bin/gcc -o
CMakeFiles/cmTC_e97bb.dir/testCXXCompiler.cxx.o -c
/local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_e97bb
/afs/.../cmake/3.7.2-1/bin/cmake
-E cmake_link_script CMakeFiles/cmTC_e97bb.dir/link.txt --verbose=1
/.../4.9.1/Linux_x86_64_compiled/bin/gcc
CMakeFiles/cmTC_e97bb.dir/testCXXCompiler.cxx.o -o cmTC_e97bb -rdynamic
/usr/bin/ld: unrecognized option '-plugin'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_e97bb] Error 1
gmake[1]: Leaving directory
`/local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_e97bb/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
examples/CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
Google didnt help. Any adivse appreciate.
I was trying to install global from source. I run
./configure --with-exuberant-ctags=/usr/bin/ctags
and it runs OK. However, when I run
make
it gives the error
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o gtags-cscope gtags-cscope.o alloc.o basename.o
build.o command.o display.o edit.o exec.o find.o help.o history.o input.o logdir.o mouse.o mygetenv.o mypop
en.o ../libparser/libgloparser.a ../libutil/libgloutil.a ../libdb/libglodb.a ../libglibc/libgloglibc.a -llt
dl -lncurses
libtool: link: gcc -g -O2 -o gtags-cscope gtags-cscope.o alloc.o basename.o build.o command.o display.o edi
t.o exec.o find.o help.o history.o input.o logdir.o mouse.o mygetenv.o mypopen.o ../libparser/libgloparser
.a ../libutil/libgloutil.a ../libdb/libglodb.a ../libglibc/libgloglibc.a -lltdl -lncurses
/usr/bin/ld: input.o: undefined reference to symbol 'erasechar'
/usr/lib/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:461: gtags-cscope] Error 1
make[2]: Leaving directory '/home/pspencil/tmp/global-6.5.7/gtags-cscope'
make[1]: *** [Makefile:517: all-recursive] Error 1
make[1]: Leaving directory '/home/pspencil/tmp/global-6.5.7'
make: *** [Makefile:424: all] Error 2
I have installed the package ncurses which apparently should provide the erase char symbol. I cannot find anything useful on Google.
Explicitly link the tinfo library.
NCurses uses tinfo, from what I have read ncurses should include the tinfo functionality in it's own library, maybe this has changed recently.
I am trying to run a python script, but I stumble upon the following errors while running it.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
P2PSP_LIBRARY
linked by target "splitter" in directory /home/billy/Desktop/p2psp-console-master
linked by target "peer" in directory /home/billy/Desktop/p2psp-console-master
-- Configuring incomplete, errors occurred!
See also "/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeError.log".
This is my cmake error log.
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec2187325408/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2187325408.dir/build.make CMakeFiles/cmTryCompileExec2187325408.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o -c /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec2187325408
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2187325408.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o -o cmTryCompileExec2187325408 -rdynamic
CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec2187325408.dir/build.make:88: recipe for target 'cmTryCompileExec2187325408' failed
make[1]: *** [cmTryCompileExec2187325408] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec2187325408/fast' failed
make: *** [cmTryCompileExec2187325408/fast] Error 2
File /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
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/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec2407202235/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2407202235.dir/build.make CMakeFiles/cmTryCompileExec2407202235.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2407202235.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec2407202235.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.2/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2407202235
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2407202235.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec2407202235.dir/CheckFunctionExists.c.o -o cmTryCompileExec2407202235 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec2407202235.dir/build.make:88: recipe for target 'cmTryCompileExec2407202235' failed
make[1]: *** [cmTryCompileExec2407202235] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec2407202235/fast' failed
make: *** [cmTryCompileExec2407202235/fast] Error 2
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec1093226452/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1093226452.dir/build.make CMakeFiles/cmTryCompileExec1093226452.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o -c /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec1093226452
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1093226452.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o -o cmTryCompileExec1093226452 -rdynamic
CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec1093226452.dir/build.make:88: recipe for target 'cmTryCompileExec1093226452' failed
make[1]: *** [cmTryCompileExec1093226452] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec1093226452/fast' failed
make: *** [cmTryCompileExec1093226452/fast] Error 2
File /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
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/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec3293591889/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3293591889.dir/build.make CMakeFiles/cmTryCompileExec3293591889.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3293591889.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3293591889.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.2/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec3293591889
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3293591889.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3293591889.dir/CheckFunctionExists.c.o -o cmTryCompileExec3293591889 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec3293591889.dir/build.make:88: recipe for target 'cmTryCompileExec3293591889' failed
make[1]: *** [cmTryCompileExec3293591889] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec3293591889/fast' failed
make: *** [cmTryCompileExec3293591889/fast] Error 2
I have been trying different solutions. But the same error occurs again and again. Can anyone suggest me a solution? Thanks in advance.