'RTLD_NEXT' 未声明 [英] 'RTLD_NEXT' undeclared
问题描述
我正在尝试编译一个 C 程序,但我收到了未声明的错误RTLD_NEXT".我认为这应该在c程序包含的dlfcn.h中定义,但是当我查看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 标准.所以 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 和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屋!