Making CMake not report errors regarding -lpthread and -ldl
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a project which doesn't use threads, but does use dynamic libraries. (And it depends on Boost, which may be using threads.) I use CMake for build configuration.
Now, even though CMake concludes and generates my Makefile just fine, I still get errors in the error log regarding attempts to determine threads and dynamic library-related code can be used:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_84a81/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_84a81.dir/build.make CMakeFiles/cmTC_84a81.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o
/usr/bin/cc -fPIC -o CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/Check
SymbolExists.c
Linking C executable cmTC_84a81
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84a81.dir/link.txt --verbose=1
/usr/bin/cc -fPIC CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -o cmTC_84a81 -rdynamic
CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_84a81.dir/build.make:97: recipe for target 'cmTC_84a81' failed
make[2]: *** [cmTC_84a81] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_84a81/fast' failed
make[1]: *** [cmTC_84a81/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
File /home/joeuser/src/mine/myproject/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/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a2619/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_a2619.dir/build.make CMakeFiles/cmTC_a2619.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3
.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_a2619
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a2619.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -o cmTC_a2619 -rdynamic -l
pthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_a2619.dir/build.make:97: recipe for target 'cmTC_a2619' failed
make[2]: *** [cmTC_a2619] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_a2619/fast' failed
make[1]: *** [cmTC_a2619/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Performing C SOURCE FILE Test LIBDL_NEEDS_UNDERSCORE failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_ac6b3/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_ac6b3.dir/build.make CMakeFiles/cmTC_ac6b3.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ac6b3.dir/src.c.o
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE -o CMakeFiles/cmTC_ac6b3.dir/src.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_ac6b3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ac6b3.dir/link.txt --verbose=1
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE CMakeFiles/cmTC_ac6b3.dir/src.c.o -o cmTC_ac6b3 -rdynamic -ldl
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Return value: 1
Source file was:
#include <dlfcn.h>
#include <stdlib.h>
void testfunc()
int main()
testfunc();
if (dlsym(0, "_testfunc") != (void*)0)
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
I want to make this go away; as, after all, my system is fine and I shouldn't get any errors. So, is this:
- A distribution bug?
- A CMake bug?
- A CMake "mis-feature"?
- A neglect on my part to pass some appropriate switches to CMake?
- Some kind of problem with my code or with Boost?
... and of course - what should I do about it?
(Related question on SX: Building error using cmake: cannot find -lpthreads)
dynamic-linking cmake pthreads
add a comment |Â
up vote
0
down vote
favorite
I have a project which doesn't use threads, but does use dynamic libraries. (And it depends on Boost, which may be using threads.) I use CMake for build configuration.
Now, even though CMake concludes and generates my Makefile just fine, I still get errors in the error log regarding attempts to determine threads and dynamic library-related code can be used:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_84a81/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_84a81.dir/build.make CMakeFiles/cmTC_84a81.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o
/usr/bin/cc -fPIC -o CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/Check
SymbolExists.c
Linking C executable cmTC_84a81
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84a81.dir/link.txt --verbose=1
/usr/bin/cc -fPIC CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -o cmTC_84a81 -rdynamic
CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_84a81.dir/build.make:97: recipe for target 'cmTC_84a81' failed
make[2]: *** [cmTC_84a81] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_84a81/fast' failed
make[1]: *** [cmTC_84a81/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
File /home/joeuser/src/mine/myproject/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/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a2619/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_a2619.dir/build.make CMakeFiles/cmTC_a2619.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3
.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_a2619
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a2619.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -o cmTC_a2619 -rdynamic -l
pthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_a2619.dir/build.make:97: recipe for target 'cmTC_a2619' failed
make[2]: *** [cmTC_a2619] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_a2619/fast' failed
make[1]: *** [cmTC_a2619/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Performing C SOURCE FILE Test LIBDL_NEEDS_UNDERSCORE failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_ac6b3/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_ac6b3.dir/build.make CMakeFiles/cmTC_ac6b3.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ac6b3.dir/src.c.o
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE -o CMakeFiles/cmTC_ac6b3.dir/src.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_ac6b3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ac6b3.dir/link.txt --verbose=1
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE CMakeFiles/cmTC_ac6b3.dir/src.c.o -o cmTC_ac6b3 -rdynamic -ldl
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Return value: 1
Source file was:
#include <dlfcn.h>
#include <stdlib.h>
void testfunc()
int main()
testfunc();
if (dlsym(0, "_testfunc") != (void*)0)
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
I want to make this go away; as, after all, my system is fine and I shouldn't get any errors. So, is this:
- A distribution bug?
- A CMake bug?
- A CMake "mis-feature"?
- A neglect on my part to pass some appropriate switches to CMake?
- Some kind of problem with my code or with Boost?
... and of course - what should I do about it?
(Related question on SX: Building error using cmake: cannot find -lpthreads)
dynamic-linking cmake pthreads
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a project which doesn't use threads, but does use dynamic libraries. (And it depends on Boost, which may be using threads.) I use CMake for build configuration.
Now, even though CMake concludes and generates my Makefile just fine, I still get errors in the error log regarding attempts to determine threads and dynamic library-related code can be used:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_84a81/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_84a81.dir/build.make CMakeFiles/cmTC_84a81.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o
/usr/bin/cc -fPIC -o CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/Check
SymbolExists.c
Linking C executable cmTC_84a81
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84a81.dir/link.txt --verbose=1
/usr/bin/cc -fPIC CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -o cmTC_84a81 -rdynamic
CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_84a81.dir/build.make:97: recipe for target 'cmTC_84a81' failed
make[2]: *** [cmTC_84a81] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_84a81/fast' failed
make[1]: *** [cmTC_84a81/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
File /home/joeuser/src/mine/myproject/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/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a2619/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_a2619.dir/build.make CMakeFiles/cmTC_a2619.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3
.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_a2619
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a2619.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -o cmTC_a2619 -rdynamic -l
pthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_a2619.dir/build.make:97: recipe for target 'cmTC_a2619' failed
make[2]: *** [cmTC_a2619] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_a2619/fast' failed
make[1]: *** [cmTC_a2619/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Performing C SOURCE FILE Test LIBDL_NEEDS_UNDERSCORE failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_ac6b3/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_ac6b3.dir/build.make CMakeFiles/cmTC_ac6b3.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ac6b3.dir/src.c.o
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE -o CMakeFiles/cmTC_ac6b3.dir/src.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_ac6b3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ac6b3.dir/link.txt --verbose=1
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE CMakeFiles/cmTC_ac6b3.dir/src.c.o -o cmTC_ac6b3 -rdynamic -ldl
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Return value: 1
Source file was:
#include <dlfcn.h>
#include <stdlib.h>
void testfunc()
int main()
testfunc();
if (dlsym(0, "_testfunc") != (void*)0)
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
I want to make this go away; as, after all, my system is fine and I shouldn't get any errors. So, is this:
- A distribution bug?
- A CMake bug?
- A CMake "mis-feature"?
- A neglect on my part to pass some appropriate switches to CMake?
- Some kind of problem with my code or with Boost?
... and of course - what should I do about it?
(Related question on SX: Building error using cmake: cannot find -lpthreads)
dynamic-linking cmake pthreads
I have a project which doesn't use threads, but does use dynamic libraries. (And it depends on Boost, which may be using threads.) I use CMake for build configuration.
Now, even though CMake concludes and generates my Makefile just fine, I still get errors in the error log regarding attempts to determine threads and dynamic library-related code can be used:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_84a81/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_84a81.dir/build.make CMakeFiles/cmTC_84a81.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o
/usr/bin/cc -fPIC -o CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/Check
SymbolExists.c
Linking C executable cmTC_84a81
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84a81.dir/link.txt --verbose=1
/usr/bin/cc -fPIC CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o -o cmTC_84a81 -rdynamic
CMakeFiles/cmTC_84a81.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_84a81.dir/build.make:97: recipe for target 'cmTC_84a81' failed
make[2]: *** [cmTC_84a81] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_84a81/fast' failed
make[1]: *** [cmTC_84a81/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
File /home/joeuser/src/mine/myproject/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/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a2619/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_a2619.dir/build.make CMakeFiles/cmTC_a2619.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3
.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_a2619
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a2619.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_a2619.dir/CheckFunctionExists.c.o -o cmTC_a2619 -rdynamic -l
pthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_a2619.dir/build.make:97: recipe for target 'cmTC_a2619' failed
make[2]: *** [cmTC_a2619] Error 1
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_a2619/fast' failed
make[1]: *** [cmTC_a2619/fast] Error 2
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Performing C SOURCE FILE Test LIBDL_NEEDS_UNDERSCORE failed with the following output:
Change Dir: /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_ac6b3/fast"
make[1]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_ac6b3.dir/build.make CMakeFiles/cmTC_ac6b3.dir/build
make[2]: Entering directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ac6b3.dir/src.c.o
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE -o CMakeFiles/cmTC_ac6b3.dir/src.c.o -c /home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_ac6b3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ac6b3.dir/link.txt --verbose=1
/usr/bin/cc -DLIBDL_NEEDS_UNDERSCORE CMakeFiles/cmTC_ac6b3.dir/src.c.o -o cmTC_ac6b3 -rdynamic -ldl
make[2]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
make[1]: Leaving directory '/home/joeuser/src/mine/myproject/CMakeFiles/CMakeTmp'
Return value: 1
Source file was:
#include <dlfcn.h>
#include <stdlib.h>
void testfunc()
int main()
testfunc();
if (dlsym(0, "_testfunc") != (void*)0)
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
I want to make this go away; as, after all, my system is fine and I shouldn't get any errors. So, is this:
- A distribution bug?
- A CMake bug?
- A CMake "mis-feature"?
- A neglect on my part to pass some appropriate switches to CMake?
- Some kind of problem with my code or with Boost?
... and of course - what should I do about it?
(Related question on SX: Building error using cmake: cannot find -lpthreads)
dynamic-linking cmake pthreads
dynamic-linking cmake pthreads
asked Oct 8 '17 at 12:34
einpoklum
1,94941846
1,94941846
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396823%2fmaking-cmake-not-report-errors-regarding-lpthread-and-ldl%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password