Hi All,
I have very simple code. Consists of a main.cc and func.cc. The files compile fine, but when I link them (g++ main.cc func.cc -o prog) I get the following error:
ld: duplicate symbol _R in main.o and func.o
collect2: ld returned 1 exit status
make: *** [main] Error 1
Both files depend on and include a header file (#include "header.h"). The files are self explanatory, in my main.cc I have the main function that calls several subroutines from func.cc. When I appened the functions from func.cc at the end of main.cc and just run (g++ main.cc -o prog) it compiles, links and runs fine! Can anyone allude to what is going on here?
Cheers, ScKaSx
I have very simple code. Consists of a main.cc and func.cc. The files compile fine, but when I link them (g++ main.cc func.cc -o prog) I get the following error:
ld: duplicate symbol _R in main.o and func.o
collect2: ld returned 1 exit status
make: *** [main] Error 1
Both files depend on and include a header file (#include "header.h"). The files are self explanatory, in my main.cc I have the main function that calls several subroutines from func.cc. When I appened the functions from func.cc at the end of main.cc and just run (g++ main.cc -o prog) it compiles, links and runs fine! Can anyone allude to what is going on here?
Cheers, ScKaSx