运行 makeconfig 时未定义对符号“acs_map”的引用

3 compiling kernel

当我尝试使用以下命令配置 Linux 内核时出现链接器错误menuconfig

# make menuconfig
  HOSTLD  scripts/kconfig/mconf
/usr/local/bin/ld: scripts/kconfig/lxdialog/checklist.o: undefined reference to symbol 'acs_map'
/usr/local/bin/ld: note: 'acs_map' is defined in DSO /lib/libtinfo.so.5 so try adding it to the linker command line
/lib/libtinfo.so.5: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2
Run Code Online (Sandbox Code Playgroud)

知道它有什么问题吗?我正在运行 CentOS 6.2,并且我确定我已经安装了所有需要的库。

小智 7

将 binutils 升级到 2.22 后,我遇到了同样的问题。我通过将以下行添加到scripts/kconfig/Makefile来解决它:

HOSTLOADLIBES_mconf     = -ltinfo
Run Code Online (Sandbox Code Playgroud)

显然,链接器中的更改不再包含免费的库;您必须明确链接到您的应用程序需要的每个库。有关更多信息,请参阅以下内容:DSO 链接更改

对于 3.2.58 内核,添加-ltinfoHOSTLOADLIBES_mconf 行的末尾;所以原文:

HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
Run Code Online (Sandbox Code Playgroud)

会变成:

HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) -ltinfo
Run Code Online (Sandbox Code Playgroud)