4
현재 ncurses로 놀고 있습니다. Ncurses는 내가 설치 한 라이브러리이며, 내 자신의 파일이 아닙니다. 이미 몇 가지 작업을 해봤지만 IDE를 사용하는 것이 훨씬 쉽기 때문에 CLion을 사용하기로 결정했습니다 (Linux에서 Visual Studio를 사용할 수 없음).CLion CMake의 ncurses 링크
cmake_minimum_required(VERSION 3.6)
project(ncurses)
set(CMAKE_C_STANDARD "${CMAKE_C_FLAGS} -Wall -Werror -lpdcurses")
set(SOURCE_FILES main.cpp ncurses.h)
add_executable(ncurses ${SOURCE_FILES})
내 프로젝트가 중요 더라면 나도 몰라 ncurses의라고 : 나는 다음 CMakeLists.txt을 얻었다. 나는 문제가 무엇인지하지 않는
/opt/clion/bin/cmake/bin/cmake --build /home/josh/ClionProjects/ncurses /cmake-build-debug --target all -- -j 4
make[2]: *** No rule to make target 'CMakeFiles/ncurses.dir/build'. Stop.
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ncurses.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
:
나는#include <ncurses.h>
int main() {
initscr();
printw("Hello");
refresh();
getch();
endwin();
return 0;
}
그러나, 나는 다음과 같은 오류를 얻을 다음 MAIN.CPP을 얻었다. lpdcurses
을 제외한 -lncurses
을 시도했지만 작동하지 않습니다. 건물에만 오류가 있지만 IDEA에는 오류가 없습니다. 당신의 CMakeLists.txt
에서