gcc Linking problem ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

Would you please let me know why I have this error when I try to link
my object files:

$Âgcc -c stack.cpp -o stack.o
$Âgcc -c main.c -o main.o
$ gcc main.o stack.o -o hello
main.o: In function `main':
main.c:(.text+0x7): undefined reference to `find_in_map'
collect2: ld returned 1 exit status

--// main.c -------------
#include "stack.h"
#include "stdio.h"

int main(){
find_in_map();
return 0;
}
--// stack.h --------------
void find_in_map();

--// stack.cpp -----------
#include <stdio.h>
#include "stack.h"
void find_in_map(){
 printf("hello");
}



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux