Консультация № 176872
24.02.2010, 00:16
0.00 руб.
0 4 1
Еще раз здрасти. Вам так тяжело мне помочь??? У меня уже другой вопрос, у меня выбивает ошибку: fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory. Помогите скомпилить!!!!

Приложение:
/*
* CLOCK By VISHNU
* Copyright(c) 2006, Vishnu
* India
* This code is free to use, if and only if you know the theory behind the code (The Clock Dial).
* Else, this copyright notice is intented to be here.
* Mail me: hvishnu999@gmail.com
* ( Message for Keralites: Ella malayalikalkkum ente shubha dinashamsakal )
*/
#include <graphics.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <conio.h>
#include<math.h>
#include<dos.h>
#include<string.h>
#include<iostream.h>

//
#define S_N_L (radius-10) // Second Needle Length
#define S_N_C RED // Second needle Color
#define M_N_L (radius-20) // Minute Needle Length
#define M_N_C LIGHTRED // Minute Needle Color
#define H_N_L (radius-(radius/2)) // Hour Needle Length
#define H_N_C CYAN // Hour Needle Color
//

float cx,cy;
float radius=100;

void draw_face(float radius);
void get_time(int &h,int &m,int &s);
void second_needle(int s);
void minute_needle(int m,int s);
void hour_needle(int h,int m,int s);

void main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver,&gmode,"");
/***********************************/
cx=getmaxx()/2.0; // cx is center x value.
cy=getmaxy()/2.0; // cy is center y value.
/** Now the point (cx,cy) is the center of your screen. **/

float x,y;
int hour,minute,second;
draw_face(radius);
while(!kbhit())
{
get_time(hour,minute,second);
second_needle(second);
minute_needle(minute,second);
hour_needle(hour,minute,second);
circle(cx,cy,2);
delay(100);
}


getch();
closegraph();

}
//*************** FUNCTIONS DEFINITIONS *****************//

void draw_face(float radius)
{

int theta=0; // theta is the angle variable.
float x,y;
/** Draw Clock Border. **/
circle(cx,cy,radius+24);
circle(cx,cy,radius+23);
/** Draw GREEN material border. **/
setcolor(BROWN); // I like a wooden frame!
/** Paint the border. **/
for(int i=0;i<9;i++)
circle(cx,cy,radius+13+i);
/** Set the color white. **/
setcolor(WHITE);
/** Draw outer-inner border. **/
circle(cx,cy,radius+12);
circle(cx,cy,radius+10);
/** Draw center dot. **/
circle(cx,cy,2);
i=0;
/** DRAW NUMERIC POINTS **/
do{
/** Getting (x,y) for numeric points **/
x=cx+radius*cos(theta*M_PI/180);
y=cy+radius*sin(theta*M_PI/180);
/** Draw Numeric Points **/
circle(x,y,2);
/* Draw Dots around each numeric points **/
circle(x+5,y,0);
circle(x-5,y,0);
circle(x,y+5,0);
circle(x,y-5,0);
/** Increase angle by 30 degrees, which is the circular distance between each numeric points. **/
theta+=30;
/** Increase i by 1. **/
i++;

} while(i!=12); //LIMIT NUMERIC POINTS UPTO =12= Numbers.
i=0;
/** DRAW DOTS BETWEEN NUMERIC POINTS. **/
do{
putpixel(cx+radius*cos(i*M_PI/180),cy+radius*sin(i*M_PI/180),DARKGRAY);
i+=6;
}while(i!=360);

/** FACE COMPLETELY DRAWN. **/
}
//================
/** Function to get the current time. **/
void get_time(int &h,int &m,int &s)
{
struct time t;
gettime(&t);
h=t.ti_hour;
m=t.ti_min;
s=t.ti_sec;
}
//=================
/** Function to draw Second needle. **/
void second_needle(int s)
{

float angle=-90;
float sx,sy;
setcolor(0);
sx=cx+S_N_L*cos((angle+s*6-6)*M_PI/180);
sy=cy+S_N_L*sin((angle+s*6-6)*M_PI/180);
line(cx,cy,sx,sy);
setcolor(S_N_C);
sx=cx+S_N_L*cos((angle+s*6)*M_PI/180);
sy=cy+S_N_L*sin((angle+s*6)*M_PI/180);
line(cx,cy,sx,sy);
}
/** Function to draw Minute needle. **/
void minute_needle(int m,int s)
{
float angle=-90;
float sx,sy;
setcolor(0);
sx=cx+M_N_L*cos((angle+m*6-6)*M_PI/180);
sy=cy+M_N_L*sin((angle+m*6-6)*M_PI/180);
line(cx,cy,sx,sy);
setcolor(M_N_C);
sx=cx+M_N_L*cos((angle+m*6/*+(s*6/60)*/)*M_PI/180);
sy=cy+M_N_L*sin((angle+m*6/*+(s*6/60)*/)*M_PI/180);
line(cx,cy,sx,sy);
}
/** Function to draw Hour needle. **/
void hour_needle(int h,int m,int s)
{
float angle=-90;
float sx,sy;
setcolor(0);
sx=cx+H_N_L*cos((angle+h*30-(m*30/60))*M_PI/180);
sy=cy+H_N_L*sin((angle+h*30-(m*30/60))*M_PI/180);
line(cx,cy,sx,sy);
setcolor(H_N_C);
sx=cx+H_N_L*cos((angle+h*30+(m*30/60))*M_PI/180);
sy=cy+H_N_L*sin((angle+h*30+(m*30/60))*M_PI/180);
line(cx,cy,sx,sy);
}
/*
Hey programmer! Did you see the Da Vinci Code ?
5468652053656372657420626568696E64206576657279206372656174696F6E206973202E2E2E20536F6D65207468696E67207370656369616C2E2E2E
*/

Обсуждение

Неизвестный
24.02.2010, 00:39
общий
это ответ
Здравствуйте, Kutishevsky A.N.

Судя по сообщению, Вы пытаетесь скомпилировать программу в Visual C++, предположительно — под Windows.
А по приложенному исходнику — это программа для DOS, причем для Borland C++.
Вот Вам и причина, почему не удается скомпилировать.

Успехов!
Неизвестный
24.02.2010, 00:43
общий
Kutishevsky A.N:
Ваш вопрос 176819 — далеко не на 5 минут, и даже не на 15! На ответ дается 5 дней.

Неизвестный
24.02.2010, 07:01
общий
оффтопик: нам не тяжело, но у многих выходные

Ошибка "Cannot open include file", говорит о том, что компилятор не может найти внешний файл, указанный в директиве #include
возможные причины:
- имя файла указано неверно
- файл действительно отсутсвует на машине (какая-то стороннаяя библиотека, требующая дополнительных установок)
- неверно или неполностью указаны пути для файлов, подключаемых директивой #include. В таком случае надо читать документацию по настройке IDE в которой работаете.
давно
Старший Модератор
31795
6196
24.02.2010, 12:19
общий
Kutishevsky A.N:
Скомпилировал Ваш код с помощью Borland C++ 3.1.
Файл программы в папке BC\BIN, туда же скопировал EGAVGA.BGI.
В дополнение прописал в настройках Option | Directories:
URL >>(добавил ссылку на рисунок)

Итого: минутная(красная) и часовая(синяя) стрелки двигаеются только когда секундная(красная) пройдет "0"

[offtop]причем тут WAPI?[/offtop]
Об авторе:
Мне безразлично, что Вы думаете о обо мне, но я рад за Вас - Вы начали думать.

Форма ответа