This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

need help


Hello....

Please excuse my childish question but I am new in the field and I am lost due to a very simple problem.
Here is my problem:
Main program:
//main.c
#include <stdio.h>
#include "funct.h"

void main(void){
printf("Calling external function\n");
foo(3);
}
////////////////////
//funct.h
.....
extern void foo(int);
.....

////////////////////
//funct.c
#include <stdio.h>
#include "funct.h"
..........
void foo(int x){printf("My parameter was:%d\n",x);};
..................
Here is what i get from gcc (in fact is ld, isn't it?)

/tmp/ccahK6eu1.o: In function `main':
/tmp/ccahK6eu1.o(.text+0x29): undefined reference to `foo'

I do not understand why ld can not resolve symbol. The compiling phase works fine
I do have a SuSE 6.3 Linux distribution whith gcc-2.7.2.3-63 on it.

Thank you in advance.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]