Bug#875452: libcsfml-dev: impossible to use libsfml since libcsfml header is in /usr/include/SFML
James Cowgill
jcowgill at debian.org
Mon Sep 11 14:12:27 UTC 2017
Control: tags -1 moreinfo
Hi,
On 11/09/17 14:49, NathV wrote:
> Package: libcsfml-dev
> Version: 2.3-3+b1
> Severity: important
>
> Dear Maintainer, I was trying to compile an SFML project.
>
> > g++ -c main.cpp
> > g++ main.o -o test -lsfml-graphics -lsfml-window -lsfml-system
>
> main.o: In function `main':
> main.cpp:(.text+0xc8): undefined reference to
> `sf::CircleShape::CircleShape(float, unsigned int)'
> collect2: error: ld returned 1 exit status
I cannot reproduce this error. The "unsigned int" suggests to me that
you are using mismatched headers / libraries since that constructor does
not use "unsigned int" in that version.
> Then i've uninstalled libcsfml, and it was working. I think the problem come
> from the fact that in /usr/include/SFML there is both libcsfml and libsfml
> header.
>
> > ls /usr/include/SFML
> Audio Config.hpp Main.hpp OpenGL.h System.hpp
> Audio.h Graphics Network OpenGL.hpp Window
> Audio.hpp Graphics.h Network.h System Window.h
> Config.h Graphics.hpp Network.hpp System.h Window.hpp
> > sudo apt-get remove "libcsfml*"
> > ls /usr/include/SFML
> Audio Graphics Network System Window.hpp
> Audio.hpp Graphics.hpp Network.hpp System.hpp
> Config.hpp Main.hpp OpenGL.hpp Window
I think this is a red herring. The headers should be completely separate
(no header includes a header from the wrong package).
> more details here: https://en.sfml-dev.org/forums/index.php?topic=22492.0
That thread suggests that you have some old versions of SFML lying
around. Please can you search through /usr/local and remove all traces
of SFML / CSFML and then try again.
If it still fails, running g++ like this might be useful. It should give
the full path to all the SFML headers and libraries being used:
> g++ -Wl,--verbose -H main.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system 2>&1 | grep -i sfml
Also what version of libsfml-dev do you have installed?
Thanks,
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20170911/df5fafee/attachment.sig>
More information about the Pkg-games-devel
mailing list