|
이와 관련된 헤더 화일을 정의한후 다음과 같이 코딩을 하였는데
자꾸 에러가 발생하네요 (볼랜드c++ 3.1)
혹시 option에서 설정을 잘못한 것은 아닌가요?
(참고로 visualc++에서는 정상적으로 동작합니다)
error : undefined simbol _main in module c0.asm
#include "car.h"
car :: car(int destination)
{
rand();
dest = destination;
forward = 1;
position = 0;
}
int car :: steercar(void)
{
cout<<"driving...\n";
getch();
if( ++position == dest)
return 1;
else
return 0;
}
void car :: reversecar(void)
{
if(forward)
{
cout<<"braking up\n";
getch();
--position ;
forward = 0;
}
else
{
forward = 1;
}
}
#include"PASSCAR.H"
int passcar :: pass(void)
{
cout<<"passing ........\n";
getch();
position = position+2;
if(position >=dest)
return 1;
else
return 0;
}
int findobstacle(void)
{
int r = rand();
if(r)
return 0;
else
return 1;
}
void main(void)
{
rand();
car2.startcar();
while( !at_destination )
{
at_destination = car2.steercar();
obstacle = findobstacle();
if ( obstacle && !at_destination)
{
cout<<" look out! there's something in the road !n";
getch();
car2.brakecar();
car2.reversecar();
at_destination = car2.pass();
}
}
cout<<"Ah, home at last \n ";
car2.turnoffcar();
}
error : undefined simbol _main in module c0.asm
많은 노력을 해 보았지만 초보라 그런지 해결이 안되서 이렇게 글을 올립니다.
해결책을 제시해 주시면 감사하겠습니다.
꼭 좀 부탁합니다.
|