facebookresearch / ELF

An End-To-End, Lightweight and Flexible Platform for Game Research
Other
2.09k stars 284 forks source link

Unable to compile miniRTS for TD and CF #25

Closed bloodymeli closed 7 years ago

bloodymeli commented 7 years ago

Hi,

I'm able to compile the backend for TD and CF. The instructions work fine for MC. The command make minirts GAME_DIR=../game_TD

results in

Linking ...
obj/main_loop.o: In function `PlayerSelector::GetPlayer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)':
main_loop.cc:(.text._ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi[_ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi]+0x43): undefined reference to `vtable for HitAndRunAI'
main_loop.cc:(.text._ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi[_ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi]+0x21d): undefined reference to `vtable for SimpleAI'
collect2: error: ld returned 1 exit status
Makefile:73: recipe for target 'minirts' failed
make: *** [minirts] Error 1

while make minirts GAME_DIR=../game_CF

yields:

Linking ...
obj/main_loop.o: In function `PlayerSelector::GetPlayer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)':
main_loop.cc:(.text._ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi[_ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi]+0x43): undefined reference to `vtable for HitAndRunAI'
main_loop.cc:(.text._ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi[_ZN14PlayerSelector9GetPlayerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi]+0x21d): undefined reference to `vtable for SimpleAI'
collect2: error: ld returned 1 exit status
Makefile:73: recipe for target 'minirts' failed
make: *** [minirts] Error 1
EasyHard commented 7 years ago

HitAndRunAI is declared in rts/game_MC/ai.h. For quick fix most likely the makefiles of game_TD and game_CF need a bit update. Or maybe minirts could hosts shared code.

bloodymeli commented 7 years ago

Hi,

Can you please provide instructions how to do the quick fix or update the makefiles?

EasyHard commented 7 years ago

I might speak too soon. Could you try the latest code? From https://travis-ci.org/facebookresearch/ELF it should be good.

bloodymeli commented 7 years ago

I'm afraid this issue persists...

EasyHard commented 7 years ago

Works fine for me.

qucheng commented 7 years ago

After you do make minirts for MC, you need to make clean before you can make for another game.