abodelot/wallbreaker

Makefile failure

Closed this issue · 1 comments

Makefile returns an error "undefined reference" for all functions that use sfml.

[...]
Wallbreaker.cpp:(.text+0x26b2): undefined reference to `vtable for sf::RectangleShape'
Wallbreaker.cpp:(.text+0x26cc): undefined reference to `sf::Shape::~Shape()'
obj/src/States/Wallbreaker.o: In function `Wallbreaker::updateLevelTexture()':
Wallbreaker.cpp:(.text+0x365): undefined reference to `sf::RenderTexture::display()'
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'wallbreaker' failed
make: *** [wallbreaker] Error 1

To fix it, change 19th line of makefile:

@$(CC) $(LDFLAGS) -o $@ $^

To:

@$(CC) -o $@ $^ $(LDFLAGS)

Hi @kacpmu!

Thank you for reporting the issue, and for providing the fix!
You were right, this syntax no longer works on newer versions of ld/gcc.