Bug #467
compile error
Status: | Closed | Start date: | 2013-12-23 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | Candidate for next minor release | |||
Affected version: | 5.x-svn | Platform: | Linux |
Description
[ 6%] Built target gen_gmt_headers
[ 6%] Building C object src/CMakeFiles/pslib.dir/common_runpath.c.o
/root/software/gmt/GMTdev/gmt5/trunk/src/common_runpath.c: In function 'GMT_runtime_libdir':
/root/software/gmt/GMTdev/gmt5/trunk/src/common_runpath.c:228:2: error: unknown type name 'Dl_info'
Dl_info info;
^
/root/software/gmt/GMTdev/gmt5/trunk/src/common_runpath.c:230:2: warning: implicit declaration of function 'dladdr' [-Wimplicit-function-declaration]
if ( dladdr (GMT_runtime_libdir, &info) && info.dli_fname[0] '/') {
^
/root/software/gmt/GMTdev/gmt5/trunk/src/common_runpath.c:230:49: error: request for member 'dli_fname' in something not a structure or union
if ( dladdr (GMT_runtime_libdir, &info) && info.dli_fname[0] '/') {
^
/root/software/gmt/GMTdev/gmt5/trunk/src/common_runpath.c:232:21: error: request for member 'dli_fname' in something not a structure or union
if (realpath (info.dli_fname, result) == NULL)
^
make2: * [src/CMakeFiles/pslib.dir/common_runpath.c.o] Error 1
make1: [src/CMakeFiles/pslib.dir/all] Error 2
make: ** [all] Error 2
History
#1
Updated by Paul over 7 years ago
- Status changed from New to Feedback
I get the same on Linux as well. Not sure why. gmt_config.h defines HAVE_DLADDR and then common_runpath.c includes <dlfcn.h>. But it is acting as if that did not happen....
#2
Updated by Paul over 7 years ago
Dont understand. Even if I force a #define __USE_GNU in there it behaves as if dlfcn.h is never included and dladdr etc are complete strangers. Any ideas?
#3 Updated by Anonymous over 7 years ago
I've got it working defining _GNU_SOURCE in cmake flags ie. -D_GNU_SOURCE (all of them just in case )
#4
Updated by Paul over 7 years ago
OK, so now the question is why does not cmake do this for us, i.e., one of the changes I made somehow prevents this now.
BTW, in case I did not state this: The changes is to avoid having gmt_dev.h and the tree below it contain any include code that depends on the GMT cmake configurations. We want supplement developers to be able to include gmt_dev.h to get access to the deep GMT libs (undocumented). The gmt.h only gives access to the API (documented). People who write supplements (like me) need more and most of the configured stuff is only needed to compile the various gmt_*.c library codes, including the common_*.c stuff. But in the process there must be a subtle thing that I am missing...
#5
Updated by Paul over 7 years ago
- Status changed from Feedback to Resolved
Rolled back to 12662 and will continue work in a branch newinc.
#6
Updated by Paul over 7 years ago
- Status changed from Resolved to Closed
Closing this one as moot.