我需要将 readline.h 库导入到 Windows。我已经尝试在此处导入带有库的文件夹: C:\Qt\Tools\mingw492_32\i686-w64-mingw32\include 它是一个库,有history.h、chardefs.h、keymaps.h、readline.h等。
但是当我尝试编译这样的程序时:
if ((line= readline("my_prompt$ ")) == NULL)
exit(0);
add_history(line);
我收到此消息:
error: undefined reference to `add_history'
error: undefined reference to `impl__readline'
我真的需要它在我的机器上运行该库。非常感谢您的帮助!
最佳答案
您需要将库路径添加到您的 .pro 文件(不是您的 Makefile - 每次您更改项目配置中的任何内容时都会重写该路径):
LIBS += -lreadline
关于c - 将 readline.h 库导入到 Windows 上的 QtCreator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35946616/