I've been at this problem for a while now and couldn't find anything to solve my problem. I'm trying to use the ncurses.h library in my program but the linker failed and told me that I had undefined symbols. I fixed that by creating a new folder called includes and copying the location of ncurses.h from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/ncurses.h
to the new folder. Then I put this line into my CMakeLists.txt file: target_link_libraries(<project name> includes/ncurses.h)
. But then I got another error saying ld: library not found for -lincludes/ncurses.h
. I've tried using add_library()
but that gave me an error saying:
The target name "includes/ncurses.h" is reserved or not valid for certain
CMake features, such as generator expressions, and may result in undefined
behavior.
Does anyone have any other suggestions?