I am a macOS user with an M1 processor. For my project (without going into details) I decided to use the library: curses.h The problem is that I get an error message about "Undefined symbols for architecture arm64". I would like to ask for help in solving the problem if possible. Im using CLion. C++ standard 20, MacOS 13.2.1. Here is my code:
#include <curses.h>
int main() {
initscr();
keypad( stdscr, TRUE );
printw( "Character in bold:\n\n" );
noecho(); // 2
int letter = getch();
printw( "The pressed char is:" );
attron( A_BOLD );
printw( "%d", letter );
getch();
endwin();
}
And my error:
FAILED: NameOfProject
: && /Library/Developer/CommandLineTools/usr/bin/c++ -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/KeyBook.dir/main.cpp.o -o KeyBook && :
Undefined symbols for architecture arm64:
"_endwin", referenced from:
_main in main.cpp.o
"_initscr", referenced from:
_main in main.cpp.o
"_keypad", referenced from:
_main in main.cpp.o
"_noecho", referenced from:
_main in main.cpp.o
"_printw", referenced from:
_main in main.cpp.o
"_stdscr", referenced from:
_main in main.cpp.o
"_wattr_on", referenced from:
_main in main.cpp.o
"_wgetch", referenced from:
_main in main.cpp.o
I've tried to go online and reinstall ncurses, but it hasn't fixed anything. Using -lcurses doesn't work.