I don't know what I'm doing wrong here. Everything looks okay, but I get a Symbol Referencing Error when I compile.
Header:
------------------------------------------
Code:
inline double DegreesToRadians( double Degrees );
inline double RadiansToDegrees( double Radians );
--------------------------------------------
Functions:
------------------------------------------
Code:
using namespace std;
#include <iostream>
#include <iomanip>
#include "proj03.library.h"
#include <cmath>
double DegreesToRadians( double Degrees )
{
return Degrees / 180 * 3.1416;
}
double RadiansToDegrees( double Radians )
{
return Radians * 180/3.1416;
}
------------------------------------------------------------
Main:
-----------------------------------------------------------
Code:
using namespace std;
#include <iostream>
#include <iomanip>
#include "proj03.library.h"
int main()
{
cout << DegreesToRadians( 45 );
cout << RadiansToDegrees( 1 );
}
----------------------------------------------------------
Output:
----------------------------------------------------------
proj03.library.h:1: warning: inline function `double DegreesToRadians(double)' used but never defined
proj03.library.h:2: warning: inline function `double RadiansToDegrees(double)' used but never defined
Undefined first referenced
symbol in file
DegreesToRadians(double) /var/tmp//ccnvuYnr.o
RadiansToDegrees(double) /var/tmp//ccnvuYnr.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
-----------------------------------------------------------------
WHAT IN THE WORLD IS GOING ON. I've spent hours on this already. If anyone understands what's wrong, please help me.