Question: Apple Mach-O Linker ID Error and a Code Sign Error appears. My program (X-Code) tells me there are these errors but it won't tell me
Apple Mach-O Linker ID Error and a Code Sign Error appears. My program (X-Code) tells me there are these errors but it won't tell me where in the code the errors are. Please Help! Thanks!
#include
#include
#include
#define PI 3.14159265
void updatePosition (double pos[],double vel[]);
void updateVelocity (double vel[],const double acc[],const double timeInc[]);
void outputPosition(double pos[]);
const double timeInc = 0.001;
const double initialVelocity = 110;
const double acc[3] = {0,0.25,-9.81};
int main()
{
double pos[3],vel[3];
double elevation = 62.900;
double azimuth = 2.9;
double val = PI / 180.0;
pos[0] =0;
pos[1] =0;
pos[2] =0;
double vel_g = initialVelocity * cos(elevation * val);
double vel_a = initialVelocity * sin(elevation * val);
vel[0] = vel_g * cos(azimuth * val);
vel[1] = vel_g * sin(azimuth * val);
vel[2] = vel_a;
double time =0;
do
{
updatePosition(pos,vel);
updateVelocity(vel,acc,&timeInc);
printf("Time: %0.31f s", time);
outputPosition(pos);
time += timeInc;
}
while(pos[2] >0);
double diff_x=1000 - pos[0];
double diff = diff_x* diff_x;
double distance = sqrt(diff);
printf("Missed by %03.1f m ",distance);
printf("Author: Dalton Farrington");
printf("Azimuth: %03.1f",azimuth);
printf("Elevation angle: %03.1f ", elevation);
return 0;
}
void updatePosition(double pos[],double vel[])
{
pos[0] = vel[0]*timeInc + pos[0];
pos[1] = vel[1]*timeInc + pos[1];
pos[2] = vel[2]*timeInc + pos[2];
}
void updateVelocity(double vel[],const double acc[],const double timeInc)
{
vel[0] = vel[0] + acc[0] * timeInc;
vel[1] = vel[1] + acc[1] * timeInc;
vel[2] = vel[2] + acc[2] * timeInc;
}
void outputPosition(double pos[])
{
printf("X-Pos: %0.31f m", pos[0]);
printf("Y-Pos: %0.31f m", pos[1]);
printf("Height: %03.1f m ",pos[2]);
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
