I downloaded the pdcurses source and was able to successfully include curses.h in my project, linked the pre-compiled library, and all is well.
After hours of testing the library, I saw tuidemo.c in the demos folder, compiled it into an executable file and brilliantly! exactly what i need for my project.
Now the problem is that this is C code, and I'm working on a C ++ project in VS C ++ 2008.
I need tui.c and tui.h ββfiles. How to include this C file in my C ++ code? I saw some suggestions here
but the compiler was not happy with 100 warnings and errors.
How can I enable / enable the use of TUI pdcurses ??
thanks
EDIT:
I added the extern expression βCβ, so my test now looks like this, but I get some other type of errors
#include <stdio.h> #include <stdlib.h> using namespace std; extern "C" { #include <tui.h> } void sub0() { //do nothing } void sub1() { //do nothing } int main (int argc, char * const argv[]) { menu MainMenu[] = { { "Asub", sub0, "Go inside first submenu" }, { "Bsub", sub1, "Go inside second submenu" }, { "", (FUNC)0, "" } /* always add this as the last item! */ }; startmenu(MainMenu, "TUI - 'textual user interface' demonstration program"); return 0; }
Although it compiles successfully, it throws an error at runtime, which indicates a bad pointer:
0xC0000005: Access violation reading location 0x021c52f9
in line
startmenu(MainMenu, "TUI - 'textual user interface' demonstration program");
Not sure where to go from here. Thanks again.