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})
助けてくれてありがとう。