I'm currently playing around with ncurses. Ncurses is a library I installed, NOT my own file. I already did some stuff but using an IDE is much easier so I decided to use CLion (I'm on Linux so can't use Visual Studio). I got the following CMakeLists.txt:
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})
My project is called ncurses I don't know if that'd matter.
I got the following main.cpp
#include <ncurses.h>
int main() {
initscr();
printw("Hello");
refresh();
getch();
endwin();
return 0;
}
However, I get the following errors:
/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
I don't get what the problem is. I tried -lncurses
except of lpdcurses
but that doesn't work either. It only gives an error when building but not in the IDEA itself.