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

  • SEARCH
  • Home
  • 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

Related Questions

I have downloaded SSHCore source code which uses libssh2 library. That code build successfully,
I have downloaded php.vim file, which contains PHP-based syntax information. It should be able
I have downloaded Visual C++ 2008 and I also have the Boost library, v.
I have downloaded a dynamic library from the location: http://downloads.php.net/pierre/ . The specific file
I have downloaded an Android project. To avoid name conflicts I want to move
I have downloaded the ASP.Net MVC2 RTM source code and I'm trying to run
I have downloaded a MetaTrader MQL4 language .mq4 source-code file from here and I
have downloaded Orca to edit an MSI file. I want to remove some banner
I have downloaded a font that looks less than desirable if it is not
I have downloaded the silver light from this http://www.microsoft.com/silverlight// I need to use this

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.