Bug#762997: libsfml-dev: Fails to compile with undefined reference errors

Alex Kerr kirbyman62 at gmail.com
Fri Sep 26 21:46:18 UTC 2014


Package: libsfml-dev
Version: 2.1+dfsg2-1
Severity: important

Dear Maintainer,

While trying to package a game I made using this library, I found compilation
would not succeed with errors about an undefined reference to certain
functions. I had previously been compiling with the most recent version of the
library pulled from upstream (https://github.com/LaurentGomila/SFML), which
worked fine. I made some sample code to see if it was just my program:

// test.cpp
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
using namespace sf;

int main()
{
        RenderWindow window(VideoMode(800, 600), "My window");
        window.setSize(Vector2u(600, 400));
        return 0;
}

And compiled with:

g++ test.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system

Sure enough, this compiled fine on the upstream libs, but failed on the
packaged version. The error for the packaged version is as follows:

/tmp/ccwdiA3a.o: In function `main':
test.cpp:(.text+0x171): undefined reference to
`sf::Window::setSize(sf::Vector2<unsigned int> const&)'
collect2: error: ld returned 1 exit status

I have attached my test code.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libsfml-dev depends on:
ii  libgl1-mesa-dev [libgl-dev]    10.1.0-4
ii  libglu1-mesa-dev [libglu-dev]  9.0.0-2
ii  libsfml-audio2                 2.1+dfsg2-1
ii  libsfml-graphics2              2.1+dfsg2-1
ii  libsfml-network2               2.1+dfsg2-1
ii  libsfml-system2                2.1+dfsg2-1
ii  libsfml-window2                2.1+dfsg2-1

libsfml-dev recommends no packages.

Versions of packages libsfml-dev suggests:
pn  libsfml-doc   <none>
pn  libsfml2-dbg  <none>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c
Size: 223 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20140926/51372763/attachment.bin>


More information about the Pkg-games-devel mailing list