Graphics interface question

Hi, I want to run graphics interface on C++ compiler run by Xcode on my mac, but get the error message: 'graphics.h' file not found. Same for 'conio.h'. Where's the problem?

Here are my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <graphics.h>
#include <conio.h>

using namespace std;

int main()
{
    int i, j;
    cout << "Multiplikacijos lentelÄ—" << endl;
    for(i=1; i<=10; i++)  {
        for (j=1; j<=10; j++) {
        cout << j*i << "\t";
        }
    line(100,100,200,100)
    cout << endl;
    }
}
conio.h and graphics.h are mainly for DOS/old Windows. They are not standard C++ headers. For similar functionality on Unix-like operating systems you might want to consider using the ncurses library instead.
Peter87 thank you very much! Can you also give me an example of how to use it, so I could draw successfully lines in my c++ program on mac? Thanks!
Last edited on
I might have been wrong about graphics.h. I don't even know if the mac os terminal are able to output graphics on per-pixel level. ncurses is more like conio in that it is concerned about characters, not individual pixels. If you want to output real graphics it might be better to go for a full fledged multimedia library such as SDL or SFML.
Last edited on
Topic archived. No new replies allowed.