I'm getting a large amount of errors with the below code that I can't understand.
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
They all seem to be similar to the above, just with a different number at the end. This is most likely due to me trying to remove one of the class definitions from within the code.
#include <string>
using namespace std;
static const float MAX_SATCHEL_VOLUME = 0.20; // in m^3
static const float MAX_CARTON_VOLUME = 0.50; // in m^3
static const float MAX_PALLET_VOLUME = 2.00;// in m^3
static const float SATCHEL_COST_PER_KILO = 2.00; // in dollars
static const float CARTON_COST_PER_KILO = 1.00; // in dollars
static const float PALLET_COST_PER_KILO = 0.50; // in dollars
class freight
{
public:
enum FreightType
{
SATCHEL,
CARTON,
PALLET,
};
float cost()
{
return perKiloCost * weight;
}
private:
freight (string set_address, float set_length, float set_width, float set_height, float set_weight);
string address;
float length;
float width;
float height;
float weight;
FreightType type;
float perKiloCost;
~freight();
};
freight::freight (string set_address, float set_length, float set_width, float set_height, float set_weight)
{
address = set_address;
length = set_length;
width = set_width;
height = set_height;
weight = set_weight;
type = PALLET;
perKiloCost = 1.00;
{
float volume = length * width * height;
if(volume > MAX_PALLET_VOLUME)
{
type = PALLET;
perKiloCost = PALLET_COST_PER_KILO;
}
else if(volume > MAX_CARTON_VOLUME)
{
type = CARTON;
perKiloCost = CARTON_COST_PER_KILO;
}
else
{
type = SATCHEL;
perKiloCost = SATCHEL_COST_PER_KILO;
}
}
}
freight::~freight()
{
}
string address;
should bestd::string address;
, same for the parameter definition. – πάντα ῥεῖ