A
Ashik
I have a simple compilation question, but I haven't been able to find
an answer for it anywhere online. I've made a simplified version of
my problem using a few files. The main problem is that when I try
compiling my code using gcc in cygwin, I get this error:
$ make
gcc -L C:/temp/ -o askForHelp askForHelp.c
/cygdrive/c/DOCUME~1/Ashik/LOCALS~1/Temp/ccB46qsl.o:askForHelp.c.text
+0x45): undefined reference to `_helper'
collect2: ld returned 1 exit status
make: *** [all] Error 1
This is what my files look like:
***askForHelp.c***
#include <stdio.h>
#include "helper.h"
int main(int argc, char **arvg) {
int i = 0;
for (i = 0; i < 10; i++) {
printf("%d", helper(i));
}
}
***helper.h***
#ifndef HELPER_H
#define HELPER_H
int helper(int input);
#endif
***helper.c***
#include <stdio.h>
int helper(int input) {
return input+1;
}
I don't have that much C compilation background. Please help. Thank
you.
an answer for it anywhere online. I've made a simplified version of
my problem using a few files. The main problem is that when I try
compiling my code using gcc in cygwin, I get this error:
$ make
gcc -L C:/temp/ -o askForHelp askForHelp.c
/cygdrive/c/DOCUME~1/Ashik/LOCALS~1/Temp/ccB46qsl.o:askForHelp.c.text
+0x45): undefined reference to `_helper'
collect2: ld returned 1 exit status
make: *** [all] Error 1
This is what my files look like:
***askForHelp.c***
#include <stdio.h>
#include "helper.h"
int main(int argc, char **arvg) {
int i = 0;
for (i = 0; i < 10; i++) {
printf("%d", helper(i));
}
}
***helper.h***
#ifndef HELPER_H
#define HELPER_H
int helper(int input);
#endif
***helper.c***
#include <stdio.h>
int helper(int input) {
return input+1;
}
I don't have that much C compilation background. Please help. Thank
you.