Xcode and Curses

I'm trying to compile a C++ program on Xcode using the curses library, altough I keep getting errors with the curses commands ("Undefined symbol") . I've already added the "libncurses.5.4.tbd" in the Frameworks and Libraries. I really need help with this beucase I'm trying to solve this problem for a long time.

Thank you for any help and sorry for any bad english ! :)

Answered by PinhasCCT in 698390022

I'm trying to compile the simpliest code and I can't.

#include <curses.h>

int main()
{	
	initscr();			
	printw("Hello World !!!");	
	refresh();			
	getch();			
	endwin();			

	return 0;
}

All the curses calls get the ("Undefined symbol" problem) . My question is also, can I compile the progam by pressing the normal arrow ("Start the active scheme") ?

I really need alot of help here. Ty for everything.

Here’s what I recommend:

  1. Delete all your code from the program leaving behind just a single curses call.

  2. Does that work? If so, add small chunks of code back in until it starts failing.

  3. Once you have a minimal program that reproduces the problem, post it here. Use a code block to make it easier to read.

I’ll then try it here to see what I can see.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

I'm trying to compile the simpliest code and I can't.

#include <curses.h>

int main()
{	
	initscr();			
	printw("Hello World !!!");	
	refresh();			
	getch();			
	endwin();			

	return 0;
}

All the curses calls get the ("Undefined symbol" problem) . My question is also, can I compile the progam by pressing the normal arrow ("Start the active scheme") ?

I really need alot of help here. Ty for everything.

I miss clicked the solved marker, i'm sorry

Thanks for the info on how you’re testing this.

I was able to get this working as following:

  1. Using Xcode 13.2 on macOS 11.6.1, I created a new project from the Command Line Tool template, choosing C as the language.

  2. I replaced main.c with your code.

  3. In the Build Phases tab of the target editor, I revealed the Link Binary with Libraries slice.

  4. I clicked the add (+) button.

  5. I selected libcurse.tbd and clicked the Add button.

  6. I chose Product > Build and the tool built successfully.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Sorry for my late reply. I did the same as you and It actually built successfully. Altough I get another error which is Error opening terminal: unknown. Program ended with exit code: 1

Ty for everything and again sorry for my late reply.

Xcode and Curses
 
 
Q