Hey!
I feel like issues like these are discussed here everyday, but I cannot find any solution.
I'm trying to build JSFML for Linux (Ubuntu 12.04 LTS, 64-bit), but I keep getting undefined references for every single SFML symbol. I built SFML using CMake (no modifications or special flags set, it used to work like this before) and without errors, then copied the binaries into my JSFML dependency directories.
The build command is as follows:
[exec] Executing 'g++' with arguments:
[exec] '-I/home/pdinklag/JSFML/include'
[exec] '-I/home/pdinklag/JSFML/sfml/include'
[exec] '-I/usr/lib/jvm/java-6-openjdk-amd64/include'
[exec] '-I/usr/lib/jvm/java-6-openjdk-amd64/include/linux'
[exec] '-shared'
[exec] '-fPIC'
[exec] '-o/home/pdinklag/JSFML/out/bin/linux_x64/libjsfml.so'
[exec] '-Wl,-no-undefined,-L/home/pdinklag/JSFML/sfml/bin/linux_x64,-lstdc++,-lsfml-system,-lsfml-window,-lsfml-graphics,-lsfml-audio'
(... list of cpp files to compile)
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
I get this error for seemingly every SFML symbol:
[exec] /tmp/cc6x6B0J.o: In function `JSFML::Color::ToSFML(JNIEnv_*, _jobject*)':
[exec] Color.cpp:(.text+0x1e1): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
[exec] /tmp/cc4jQlbv.o: In function `JSFML::RenderStates::ToSFML(JNIEnv_*, _jobject*)':
[exec] RenderStates.cpp:(.text+0x201): undefined reference to `sf::RenderStates::RenderStates(sf::BlendMode, sf::Transform const&, sf::Texture const*, sf::Shader const*)'
[exec] /tmp/ccIR6QV3.o: In function `JSFML::Time::ToSFML(JNIEnv_*, _jobject*)':
[exec] Time.cpp:(.text+0xeb): undefined reference to `sf::microseconds(long long)'
[exec] /tmp/ccIR6QV3.o: In function `JSFML::Time::FromSFML(JNIEnv_*, sf::Time const&)':
[exec] Time.cpp:(.text+0x10a): undefined reference to `sf::Time::asMicroseconds() const'
[exec] /tmp/ccgkSzcD.o: In function `JSFML::Transform::ToSFML(JNIEnv_*, _jobject*)':
[exec] Transform.cpp:(.text+0x17c): undefined reference to `sf::Transform::Transform(float, float, float, float, float, float, float, float, float)'
(...)
Obviously, it fails to link against any SFML library.
Now, I made sure that the shared object files are actually found by the linker using this:
pdinklag@pdinklag-linux:~/JSFML$ ld -L/home/pdinklag/JSFML/sfml/bin/linux_x64 -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
ld: warning: cannot find entry symbol _start; not setting start address
I'd be getting a "library not found" message if anything was actually not found, so that's cleared out.
Now I'm pretty much out of ideas and feel like something went wrong linking SFML itself. As mentioned, I used the default CMake setup that's on github, no special flags set or anything, and it used to work fine before. Is there anything I missed, anything I need to make sure?