Steelerz37
Senior member
I am trying to do seperate compilation with 2 files, 1 is code given to us, the 2nd is our part of the project. It holds one function, handle_requests. Now when handle_requests is in the same file as the rest of the code it works fine, but when seperate I get this error:
[bal8784@granite CPSC423]$ g++ -o rockserver5 stripped_rockserver.cpp initechHandleRequests.cpp
/tmp/ccgkqO6F.o(.text+0x480): In function `handle_requests(int&)':
: multiple definition of `handle_requests(int&)'
/tmp/ccNEMnpC.o(.text+0x480): first defined here
collect2: ld returned 1 exit status
This is after I have fixed a ton of other errors which included errors of variables not declared in this scope, and weird missing ; errors and others. I really have no clue whats wrong.
Also I forgot to mention both of the files in /tmp change each time I try to compile.
[bal8784@granite CPSC423]$ g++ -o rockserver5 stripped_rockserver.cpp initechHandleRequests.cpp
/tmp/ccgkqO6F.o(.text+0x480): In function `handle_requests(int&)':
: multiple definition of `handle_requests(int&)'
/tmp/ccNEMnpC.o(.text+0x480): first defined here
collect2: ld returned 1 exit status
This is after I have fixed a ton of other errors which included errors of variables not declared in this scope, and weird missing ; errors and others. I really have no clue whats wrong.
Also I forgot to mention both of the files in /tmp change each time I try to compile.