Jump to content

Ncurses for windows

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
chax

chax

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
I am making a program in C that uses ncurses in linux.
I want it to write a the that I can run on windows.
Is there any ncurses lib on turbo c compiler.

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I don't think it's possible to use ncurses in Windows at all.
Maybe some multiplatform programming would be better?
It's easy, but it requires that you know alot about both Windows and Linux (or some other operating system). It can easily be done, only using the preprocessors.

#include <iostream>
#if defined(__linux__)
    // Include Linux-libraries
#elif defined(_WIN32)
   // Include Windows-libraries
#else
   #error Not supported platform/OS // Or something else here
#endif

int main()
{
    #if defined(__linux__)
        // Do something with Linux-libraries
    #elif defined(_WIN32)
        // Do something with Windows-libraries
    #endif

    return 0;
}