我正在尝试使用 GCC 5.3 在 linux 上编译 libedit,并收到一条神秘的错误消息。
/home/mybin/libgcc/x86_64-unknown-linux-gnu/5.3.0/../../../libcurses.a(lib_termcap.o): relocation R_X86_64_32 against `_nc_globals' can not be used when making a shared object; recompile with -fPIC
/home/mybin/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../libcurses.a: could not read symbols: Bad value
指的是什么recompile with -fPIC
,ncurses 或 libedit?然后我如何传递-fPIC
标志。我已经尝试添加CFLAGS=-fPIC
到配置ncurses & libedit
但仍然没有工作。
我发现可能会在 SO 上发布关于 -fPIC 是什么的帖子,但没有关于如何设置标志的帖子。
谢谢艺术