shewu / h4ck4th0n

Holy Balls: The Game
8 stars 2 forks source link

make server fails #55

Closed vladfi1 closed 8 years ago

vladfi1 commented 8 years ago

On ubuntu 15.10. The compilation appears to go smoothly but I get a ton of linking errors:

$ make server
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Socket.o src/Socket.cpp -MF "bin/deps/src/Socket.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Object.o src/Object.cpp -MF "bin/deps/src/Object.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/World.o src/World.cpp -MF "bin/deps/src/World.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/HBMap.o src/HBMap.cpp -MF "bin/deps/src/HBMap.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Packet.o src/Packet.cpp -MF "bin/deps/src/Packet.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/SocketConnection.o src/SocketConnection.cpp -MF "bin/deps/src/SocketConnection.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Material.o src/Material.cpp -MF "bin/deps/src/Material.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/MapElements.o src/MapElements.cpp -MF "bin/deps/src/MapElements.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Server.o src/Server.cpp -MF "bin/deps/src/Server.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Game.o src/Game.cpp -MF "bin/deps/src/Game.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Physics.o src/Physics.cpp -MF "bin/deps/src/Physics.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/PhysicsWorld.o src/PhysicsWorld.cpp -MF "bin/deps/src/PhysicsWorld.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/PhysicsForces.o src/PhysicsForces.cpp -MF "bin/deps/src/PhysicsForces.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/CTFGame.o src/CTFGame.cpp -MF "bin/deps/src/CTFGame.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/UserInput.o src/UserInput.cpp -MF "bin/deps/src/UserInput.d"
clang++ -c -Wall -MD -MP --std=c++0x -O2 -w -o bin/objs/Logging.o src/Logging.cpp -MF "bin/deps/src/Logging.d"
clang++ -o bin/server bin/objs/Socket.o bin/objs/Object.o bin/objs/World.o bin/objs/HBMap.o bin/objs/Packet.o bin/objs/SocketConnection.o bin/objs/Material.o bin/objs/MapElements.o bin/objs/Server.o bin/objs/Game.o bin/objs/Physics.o bin/objs/PhysicsWorld.o bin/objs/PhysicsForces.o bin/objs/CTFGame.o bin/objs/UserInput.o bin/objs/Logging.o 
clang++   server.o bin/server   -o server
bin/server:(.bss+0x2d88): multiple definition of `s'
server.o:(.bss+0x148): first defined here
bin/server: In function `_start':
(.text+0x7750): multiple definition of `_start'
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o:/build/buildd/glibc-2.21/csu/../sysdeps/x86_64/start.S:63: first defined here
bin/server: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o:/build/buildd/glibc-2.21/csu/../sysdeps/x86_64/crti.S:80: first defined here
bin/server:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
bin/server: In function `data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
bin/server: In function `data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtbegin.o:(.data+0x0): first defined here
bin/server:(.bss+0x2d78): multiple definition of `tim'
server.o:/home/vlad/Repos/h4ck4th0n/server.cpp:64: first defined here
bin/server:(.bss+0x2d48): multiple definition of `clients'
server.o:/home/vlad/Repos/h4ck4th0n/server.cpp:51: first defined here
bin/server: In function `main':
(.text+0x14450): multiple definition of `main'
server.o:/home/vlad/Repos/h4ck4th0n/server.cpp:68: first defined here
bin/server: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o:/build/buildd/glibc-2.21/csu/../sysdeps/x86_64/crti.S:64: first defined here
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
bin/server:(.data+0x10): first defined here
/usr/bin/ld: error in bin/server(.eh_frame); no .eh_frame_hdr table will be created.
server.o: In function `main':
/home/vlad/Repos/h4ck4th0n/server.cpp:153: undefined reference to `SocketConnection::send_packet(WritePacket&)'
/home/vlad/Repos/h4ck4th0n/server.cpp:155: undefined reference to `Game::remove_player(int)'
/home/vlad/Repos/h4ck4th0n/server.cpp:172: undefined reference to `Game::add_player(Client)'
/home/vlad/Repos/h4ck4th0n/server.cpp:179: undefined reference to `Game::remove_player(int)'
/home/vlad/Repos/h4ck4th0n/server.cpp:190: undefined reference to `Game::process_packet(int, ReadPacket*)'
/home/vlad/Repos/h4ck4th0n/server.cpp:212: undefined reference to `Game::send_world()'
server.o: In function `__static_initialization_and_destruction_0(int, int)':
/home/vlad/Repos/h4ck4th0n/server.cpp:45: undefined reference to `Game::Game()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<builtin>: recipe for target 'server' failed
make: *** [server] Error 1
shewu commented 8 years ago

lmao that commit fixed another issue, not this one. my bad!

shewu commented 8 years ago

h4ck4th0n/server.cpp

this looks like an older version of the repo; can you pull and try again? (compiling an older version should work, but it's not a concern now since we've probably refactored the code)

all of the sources should be under a src/ directory.

edit: wait, all the compile steps look right. why is it still looking at h4ck4th0n/server.cpp? could the old stuff not have been deleted properly?

shewu commented 8 years ago

lingering server.o from the bronze age when all source files were in the top level directory confused the compile system. removing that file resolved this issue. closing.