Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 854399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:55:05+00:00 2026-05-15T07:55:05+00:00

I have downloaded pdcurses source and was able to successfully include curses.h in my

  • 0

I have downloaded pdcurses source and was able to successfully include curses.h in my project, linked the pre-compiled library and all good.

After few hours of trying out the library, I saw the tuidemo.c in the demos folder, compiled it into an executable and brilliant! exactly what I needed for my project.

Now the problem is that it’s a C code, and I am working on a C++ project in VS c++ 2008.

The files I need are tui.c and tui.h
How can I include that C file in my C++ code? I saw few suggestions here

but the compiler was not too happy with 100’s of warnings and errors.

How can I go on including/using that TUI pdcurses includes!?

Thanks

EDIT:

I added extern “C” statement, so my test looks like this now, but I’m getting some other type of error

#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 is compiling successfully, it is throwing an Error at runtime, which suggests a bad pointer:

0xC0000005: Access violation reading location 0x021c52f9

at line

startmenu(MainMenu, "TUI - 'textual user interface' demonstration program");

Not sure where to go from here.
thanks again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:55:06+00:00Added an answer on May 15, 2026 at 7:55 am

    Finally got it working. The solution was in the steps below:

    First I renamed tui.c to tui.cpp

    For the header tui.h, I followed the exact same step of wrapping the code as described here.

    then in my project i just included the header without any extern “C” block

    #include "tui.h"
    

    Compiled and it worked!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.