janfsd
December 31st, 2005, 09:14 PM
Hi! ive got some problems with c++, well im learning it so im still a newbie in it...
i was trying to make a library and a implementation file...so i make the header which in this case looks like this:
/* Library HEat
-------------------*/
const double HeatOfFusion = 79.71; //calorias por gramo
const double HeatOfVaporization = 539.55; // calorias por gramo
/*-------------------------------------------------------------------------------------------------------
Program FahrToCelsius
------------------------------------------------------------------------------------------------------*/
double FahrToCelsius(double);
/*-------------------------------------------------------------------------------------------------------
Program CelsiusToFahr
-------------------------------------------------------------------------------------------------------*/
double CelsiusToFahr(double);
and after i made the implementation file which looks like this...
#include "Heat.h"
using namespace std;
//-------------------------------------------------------------------------------------------------------
double FahrToCelsius(double FTemp)
{
return (FTemp - 32.0) / 1.8;
}
//-------------------------------------------------------------------------------------------------------
double CelsiusToFahr(double CTemp)
{
return CTemp * 1.8 + 32.0;
}
the header i saved like Heat.h and the imp. file like Heat.C
while trying to compile Heat.C with g++ Heat.C -o Heat
it gives me the following error:
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
am i doing sthing wrong?? plz any kind of help would be appreciated! thx in advance, by the way happy new year!!
i was trying to make a library and a implementation file...so i make the header which in this case looks like this:
/* Library HEat
-------------------*/
const double HeatOfFusion = 79.71; //calorias por gramo
const double HeatOfVaporization = 539.55; // calorias por gramo
/*-------------------------------------------------------------------------------------------------------
Program FahrToCelsius
------------------------------------------------------------------------------------------------------*/
double FahrToCelsius(double);
/*-------------------------------------------------------------------------------------------------------
Program CelsiusToFahr
-------------------------------------------------------------------------------------------------------*/
double CelsiusToFahr(double);
and after i made the implementation file which looks like this...
#include "Heat.h"
using namespace std;
//-------------------------------------------------------------------------------------------------------
double FahrToCelsius(double FTemp)
{
return (FTemp - 32.0) / 1.8;
}
//-------------------------------------------------------------------------------------------------------
double CelsiusToFahr(double CTemp)
{
return CTemp * 1.8 + 32.0;
}
the header i saved like Heat.h and the imp. file like Heat.C
while trying to compile Heat.C with g++ Heat.C -o Heat
it gives me the following error:
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
am i doing sthing wrong?? plz any kind of help would be appreciated! thx in advance, by the way happy new year!!