3
« on: December 12, 2018, 09:39:38 am »
Hi,
Here's what I've been doing:
export SFML_DIR=/usr/local/lib/cmake/SFML
cmake .
make clean # just to make sure
make
Everything seems to build fine, libraries are installed in /usr/local/lib
However, when I try to build an example program from go-sfml packare using csfml, i got:
XXXXX:~/go/src/gopkg.in/teh-cmc/go-sfml.v24/examples/gosfml_example_c$ make
gcc -L /usr/lib64/ -lsfml-audio -lsfml-graphics -lcsfml-system -lsfml-system -lcsfml-window -lsfml-window -I/root/go/src/gopkg.in/teh-cmc/go-sfml.v24/examples/gosfml_example_c/../../CSFML/include -o go-sfml -lcsfml-audio -lcsfml-graphics main.c
/usr/local/lib/libcsfml-audio.so: undefined reference to `sf::SoundStream::onLoop()'
/usr/local/lib/libcsfml-graphics.so: undefined reference to `sf::RenderWindow::setActive(bool)'
I tried to use different -l order (i.e. -lsfml-audio -lcsfml-audio, -lcsfml-audio -lsfml-audio, main.c before everything else and several other combinations) and still have no success.
ld /usr/local/libcsfml-audio.so:
/usr/local/lib/libcsfml-audio.so: undefined reference to `sf::Sound::getStatus() const'
/usr/local/lib/libcsfml-audio.so: undefined reference to `sf::SoundSource::getVolume() const'
/usr/local/lib/libcsfml-audio.so: undefined reference to `sf::SoundBuffer::getSamples() const'
/usr/local/lib/libcsfml-audio.so: undefined reference to `sf::Sound::getPlayingOffset() const'
.....
Tens more follow.
I have a hunch that it would be enough to change SFMLconfig.cmake to point to a different directory, but I have no idea about cmake syntax