need help

Claudiu BRASOVEAN claudiu@rdscj.ro
Tue May 2 09:31:00 GMT 2000


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.
 




More information about the Gcc-help mailing list