General Question

iamnothuman's avatar

In C what does the error "undefined refrence to 'WinMain@16' mean?

Asked by iamnothuman (9points) April 11th, 2010

int goforth(int gfmm){
int tick=gfmm/0.13;
int tick1=tick+5;
int tick2=tick-5;
int tick3=tick+10;
clear_motor_position_counter(0);
clear_motor_position_counter(3);
mav(0,500);
mav(3,500);
while (get_motor_position_counter(0)<tick1 || get_motor_position_counter(0)>tick2){
if (get_motor_position_counter(0)>tick2){
mav(0,-100);
mav(3,-100);
}
if (get_motor_position_counter(0)>tick3 && get_motor_position_counter(0)>tick1){
mav(0,100);
mav(3,100);
}
}
printf(“i went %d”+gfmm);
mav(0,0);
mav(3,0);
beep();
}

int retreat(int fmm){
int tick=fmm/0.13;
int tick1=tick+5;
int tick2=tick-5;
int tick3=tick+10;
clear_motor_position_counter(0);
clear_motor_position_counter(3);
mav(0,-500);
mav(3,-500);
while(get_motor_position_counter(0)<tick1 || get_motor_position_counter(0)>tick2){
if (get_motor_position_counter(0)<tick2){
mav(0,100);
mav(3,100);
}
if (get_motor_position_counter(0)<tick3 && get_motor_position_counter(0)<tick1){
mav(0,-100);
mav(3,-100);
}
}
printf(“i went %d”+fmm);
mav(0,0);
mav(3,0);
beep();
}

int turncw(cw){
int tick=cw*3.15;
int tick1=tick+5;
int tick2=tick-5;
int tick3=tick-10;
mav(0,300);
clear_motor_position_counter(0);
while(get_motor_position_counter(0)>tick1 || get_motor_position_counter(0)<tick2){
if (get_motor_position_counter(0)>tick1){
mav(0,-100);
}
if (get_motor_position_counter(0)<tick2 && get_motor_position_counter(0)>tick3){
mav(0,100);
}
}
printf(“i went %d”+cw);
mav(0,0);
mav(3,0);
beep();
}

int turnccw(ccw){
int tick=ccw*3.15;
tick=tick*-1;
int tick1=tick-5;
int tick2=tick+5;
int tick3=tick+10;
mav(3,300);
clear_motor_position_counter(3);
while(get_motor_position_counter(3)<tick1 || get_motor_position_counter(3)>tick2){
if (get_motor_position_counter(3)<tick1){
mav(0,100);
}
if (get_motor_position_counter(3)>tick2 && get_motor_position_counter(3)<tick3){
mav(3,-100);
}
}
printf(“i went %d”+ccw);
mav(0,0);
mav(3,0);
beep();
}

this is my functions library for a robot i am programming in C

when i compile it using KISS 2.2.1 i get that error message

help?

Observing members: 0 Composing members: 0

4 Answers

Mulot's avatar

I would recommend you to post this on Stackoverflow.

They have the proper “code” markup to display your code. Moreover if you could give more details about your env, compile command and so on, could help a little bit.

gasman's avatar

@Mulot Thanks for a great link :)

iamnothuman's avatar

i found the awnser:
this is a .h library and should not be complied
thanks anyways

Mulot's avatar

OMG ! don’t right code in your headers ! Write the implementation in the .c file ! So you have clean headers for people to see if needed, without seeing the mess behind.

And yes indeed you just need to .h to link when you’ll compile a .c including the .h

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther