Mail Archives: djgpp/1998/09/30/17:16:12
Just came across another problem that had bugged me when using this compiler
before. For some reason it is trying to compile and link the two different
.cpp files together that I have made. 1st program is-
#include <iostream.h>
void main()
{
cout << "Hello";
}
2nd program is
#include <iostream.h>
void main()
{
cout << "Please enter the number of gallons you wish to see the cubic ";
cout << "feet equivalant of.";
float cubicfeet, gallons;
cin >> gallons;
cubicfeet = gallons / 7.481;
cout << "equivalant in cubic feet is " << cubicfeet;
}
When I try to compile the 2nd one I get these errors:
Error:hello.o: In function 'main'
Error:hello.cpp(.text+0x8): multiple definitions of 'main'
Error:exer1_1.o(.text+0x78):exer1_1.cpp:first defined here
Know what is wrong?
- Raw text -