ncurses help on Mac OS X Xcode

closed account (SzUk92yv)
I'm currently a beginner C++ programmer. Recently, I found ncurses and thought I'd give it a shot and experiment a bit. Downloaded the files, installed them, and all that. Then, I realized that ncurses comes natively with Xcode.

So, using the following block of code from this tutorial ( http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/helloworld.html ), I tried to run it as a test. However, I got some errors that I don't understand.

1
2
3
4
5
6
7
8
9
10
11
#include <ncurses.h>

int main() {	
	initscr();			/* Start curses mode 		  */
	printw("Hello World !!!");	/* Print Hello World		  */
	refresh();			/* Print it on to the real screen */
	getch();			/* Wait for user input */
	endwin();			/* End curses mode		  */

	return 0;
}


Could someone help me set up ncurses? I have no idea what I'm doing. I can't find any good tutorials that actually explain everything. Basically, all I'm finding are the shittiest tutorials ever and, pardon my language, I'm confused as fuck.

EDIT (Nov 22; approx. 7:43pm est):
Here's an image of the errors when trying to run the code - http://i.imgur.com/cj6rnsK.png

Also, is there some kind of IDE out there where I can easily create GUI elements for programs? And please, I don't want that confusing linux shit where I have to install 20 different files and run a million different terminal commands.
Last edited on
http://www.cplusplus.com/forum/general/113904/#msg622055
From your link
> To link the program with ncurses the flag -lncurses should be added.
(consult your IDE documentation)
The command would end up something like
$ clang++ foo.cpp -c
$ clang++ foo.o -lncurses -o program.bin


> EDIT (Nov 22; approx. 7:43pm est):
> Here's an image of the errors
It's nice that you realize that when you have errors you should tell what those errors are.
But an image is a terrible format to communicate them, use text next time


PS: Absolute paths adds too much noise
Last edited on
closed account (SzUk92yv)
http://www.cplusplus.com/forum/general/113904/#msg622055
From your link
> To link the program with ncurses the flag -lncurses should be added.
(consult your IDE documentation)
The command would end up something like
$ clang++ foo.cpp -c
$ clang++ foo.o -lncurses -o program.bin


> EDIT (Nov 22; approx. 7:43pm est):
> Here's an image of the errors
It's nice that you realize that when you have errors you should tell what those errors are.
But an image is a terrible format to communicate them, use text next time


PS: Absolute paths adds too much noise


I don't understand any of that. Could you explain it in-depth? And the IDE I'm using is Xcode 6.0
Topic archived. No new replies allowed.