“RTLD_NEXT”未申报 [英] 'RTLD_NEXT' undeclared
问题描述
我试图编译C程序,但我得到的错误RTLD_NEXT未申报。我觉得这是应该在dlfcn.h中其中C程序包括被定义,但是当我看了看里面dlfcn.h时会有麻烦,没有RTLD_NEXT。
I'm trying to compile a C program but I get the error 'RTLD_NEXT' undeclared. I think this is supposed to be defined in dlfcn.h which the c program includes, but when I looked inside dlfcn.h there is no RTLD_NEXT.
我该如何解决这个问题?
How do I fix this?
推荐答案
这里的问题是, RTLD_NEXT
不受posix~~V标准。所以GNU的人不启用它,除非你的#define _GNU_SOURCE
或 -D_GNU_SOURCE
。
The issue here is that RTLD_NEXT
is not defined by the posix standard . So the GNU people don't enable it unless you #define _GNU_SOURCE
or -D_GNU_SOURCE
.
POSIX是 dlfcn.h中和<一个其他相关作品href=\"http://www.opengroup.org/onlinepubs/009695399/functions/dlsym.html#tag%5F03%5F112%5F07\">dlsym.h.有趣的是,后来提到了 RTLD_NEXT
。显然,GNU的人有点困惑什么是扩展的,哪些不是。
Other relevant pieces of POSIX are dlfcn.h and dlsym.h. Interestingly, the later mentions RTLD_NEXT
. Apparently, the GNU people are a bit confused about what is an extension and what is not.
这篇关于“RTLD_NEXT”未申报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!