You are not logged in.

#1 2010-05-27 04:55:54

pseudonomous
Member
Registered: 2008-04-23
Posts: 349

does any documentation exist for using libncurses++ ?

Hi all,

I'm sort of double threading but this is something slightly less general than my last thread; I've been trying to write a simple C++ console based application that uses the ncurses menus library; There's an excellent tutorial on using ncurses menus over here, but the example code only compiles as C code not as C++ code.  (most of the example code will compile as C++ code, this particular example, however does not).

g++ complains:

"calloc" was not declared in this scrope.

g++ also wares me about depracated conversions from string constants to "char*".

I have some idea of why I get those errors/warning, but I don't know how to rewrite the code to get rid of the errors.  The possibility exists, I suppose, that while libncurses++ supports C++ calls into ncurses that the menus library does not.  Basically, I just want to know if there's already existing libraries that do what I want to do, that are documented somewhere, or if I should use a different method (i.e. use dialog and bash or ksh instead of ncurses/C++).

I'm sorry if I'm in some way being an idiot.  If I am being an idiot, please make pointed suggestions.

Thanks!

Offline

#2 2010-05-27 05:42:38

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: does any documentation exist for using libncurses++ ?

For calloc, #include <cstdlib>, and either qualify it with std::, or put "using namespace std" somewhere.  Do avoid the string conversion warnings, always use "const char *" to refer to literal string constants.  In terms of the more general questions, I'd definitely use a real language (i.e. not bash) if you're doing anything serious.  I would try to just use ncurses directly, unless libncurses++ has a very good interface.

Offline

Board footer

Powered by FluxBB