I'm running Xcode 12.4 on an M1 Mac Mini with command line tools installed. My project was created as a macOS "Command Line Tool" application. When I try to build:
#include <term.h>
int main(int argc, const char * argv[]) {
set_curterm(nullptr);
return 0;
}
I get the following linker error:
Undefined symbols for architecture arm64:
"_set_curterm", referenced from:
_main in main.o
Does anyone know what library I need to link to in order to resolve _set_curterm?
#include <term.h>
int main(int argc, const char * argv[]) {
set_curterm(nullptr);
return 0;
}
I get the following linker error:
Undefined symbols for architecture arm64:
"_set_curterm", referenced from:
_main in main.o
Does anyone know what library I need to link to in order to resolve _set_curterm?
Kinda. Xcode help does cover the process for linking to a framework or a library. The problem is that there’s no clear link between the set_curterm function and the libcurses library. This is one of the things that falls in the cracks between Apple stuff and UNIX-y stuff. Most folks who use curses are coming from a UNIX background where adding -lcurses to their linker invocation is common knowledge.Is there some way I could have used documentation to figure that out
without guessing?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"