我遇到了一个奇怪的问题,undefined reference to "PDC_ungetch"
虽然我可以毫无问题地使用 curses.h 中的其他功能,例如:
#include <curses.h>
int main(){
initscr();
int ch = getch();
ungetch(ch);
return 0;
}
使用此代码,我只能undefined reference to "PDC_ungetch"
在initscr()
没有问题的情况下获得,这会是什么问题?
我的 CMake 如下:
cmake_minimum_required(VERSION 3.3)
project(rogue)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
set(SOURCE_FILES main.c gamelib.c gamelib.h maze.c maze.h) //these are other files I use
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
add_executable(rogue ${SOURCE_FILES} gamelib.c gamelib.h maze.c maze.h) //Same here
target_link_libraries(rogue ${CURSES_LIBRARIES})
在此先感谢您的帮助。