Trying to get this program to work... weird error can someone explain please?
Write your question here.
undefined reference to `main'
collect2: error: ld returned 1 exit status
I have not seen this error before can someone explain please
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <iostream>
using namespace std;
class LED
{ private:
int bulbLife = 100;
int bulbColor = 0;
public:
int getColor()
{return bulbColor;}
void setLife(int use)
{bulbLife -= use;}
int getLife()
{return bulbLife;}
};
class StopLight
{ private:
LED socket1;
public:
void Cycle();
void Report();
};
void StopLight::Cycle()
{
socket1.setLife(1);
cout << "\nSteady";
switch (socket1.getColor())
{
case 0: cout << "White\n\n"; break;
case 1: cout << "Red\n\n"; break;
case 2: cout << "Yellow\n\n"; break;
case 3: cout << "Green\n\n"; break;
}
}
void StopLight::Report()
{
cout << "Bidwell Light Report/n" << "Power On: True" << endl;
cout << "Socket 1:" << socket1.getColor() << " "
<< socket1.getLife() << "hours left" << endl;
}
|
Your program has no main()
function. Where is it meant to start?
Lol okay yeah i see it. Im so sorry thank you
Topic archived. No new replies allowed.