This is the mail archive of the
mailing list for the GCC project.
- To: gcc at gcc dot gnu dot org
- Subject: Query:linking
- From: "Bipin T S" <bipin at lgsi dot co dot in>
- Date: Thu, 03 May 2001 15:51:04 +0530
I have just joined this list. I am facing some problems when i link .o
files created by gcc and g++ respectively.
In particular i had 3 files
void print (int j) ;
void print(int j)
And i used gcc as follows
>gcc -c test.c //fine
>g++ -c test1.cc //fine
>g++ test.o test1.o //oops!!
i get the following error
test1.o : In function main()
test1.o (.text +0x6) :undefined reference to 'print(int)'
collect2: ld returned 1 exit status
I run RED Hat 6.2 gcc version egcs-2.9166
Can anyone tell me the reason for this behavior?
Thanks in advance!