Entry point not defined?

telling me "entry point must be defined" but can not figure out the problem

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <fstream>
using namespace std;





double det(double a1, double a2, double a3, double b1, double b2 ,double b3, double c1, double c2, double c3, double d1, double d2, double d3 );


int main()


{


double a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3, x, y, z, den;

ifstream inputefile ("lab10a");

x = ((d1 * b2 * c3) + (b1 * c2 * d3) + (c1 * d2 * b3) - (c1 * b2 * d3) - (d1 * c2 * b3) - (b1 * d2 * c3))/(det(a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3 ));
y = ((a1 * d2 * c3) + (d1 * c2 * a3) + (c1 * a2 * d3) - (c1 * d2 * a3) - (a1 * c2 * d3) - (d1 * a2 * c3))/(det(a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3 ));
z = ((a1 * b2 * d3) + (b1 * d2 * a3) + (d1 * a2 * b3) - (d1 * b2 * a3) - (a1 * d2 * b3) - (b1 * a2 * d3))/(det(a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3 ));

spool << "The answers for x ,y and z would be " << x << " " << y << " " << z << endl;


spool.close();
inputfile.close();
return 0;
}

double det(double a1, double a2, double a3, double b1, double b2 ,double b3, double c1, double c2, double c3, double d1, double d2, double d3 )
{
double den;
double a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3;

den = (a1 * b2 * c3) + (b1 * c2 * a3) + (c1 * a2 * b3) - (c1 * b2 * a3) -(a1 * c2 * b2) - (b1 * a2 * c3);

return den;

}
Just going to list the problems that jump out at me with a short description, still quite early here so might miss a few ;p.

1. spool << "The answers for x ,y and z would be " << x << " " << y << " " << z << endl;
No where in the code is spool defined. So you are basically using a object that doesn't exist.

The same goes for spool.close();

2. double a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3; in your function body. You are declaring variables with the exact same names as your parameters which you shouldn't be doing. Just delete that line and use the parameter names to reference the data that is passed in while calling the function.

3. Not really a mistake but you can shorten the function to just this

1
2
3
4
double det(double a1, double a2, double a3, double b1, double b2 ,double b3, double c1, double c2, double c3, double d1, double d2, double d3 )
{
    return (a1 * b2 * c3) + (b1 * c2 * a3) + (c1 * a2 * b3) - (c1 * b2 * a3) -(a1 * c2 * b2) -             (b1 * a2 * c3);
}


EDIT:

4. inputfile.close(); that line is wrong since you declared your ifstream object to have the name inputefile and not inputfile. So just a minor typo.

Basically there is no need to declare the den variable just to return the result of the equation. But either way works and I fine some people like to have the variable and some don't.

Other then that I don't see anything glaringly obvious as to what the problem is but haven't dug into your code just did a quick glance over. So try fixing those things and if it still doesn't work we can continue from there.

EDIT: Also not sure why you get a entry point error. You really shouldn't be getting said error in this case... What compiler are you using by chance?
Last edited on
Topic archived. No new replies allowed.