Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Can't compile my game  (Read 3652 times)

0 Members and 1 Guest are viewing this topic.

grzesius

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Can't compile my game
« on: October 13, 2012, 08:05:03 am »
Hi, I'm new here, so be patient please:)

I'm trying to compile my game with SFML2.0 which I compiled like in tutorial on main page but I still have some errors and since week cant fix it :/

In makefile i have this libs:
SFML_LIB = -L/opt/libs/SFML/lib -lsfml-system-s -lsfml-window-s -lsfml-graphics-s -lsfml-audio-s -lsfml-network-s
OTHER_LIB = -L/usr/lib -pthread -lGLU -lGL -lX11 -lXrandr -lfreetype -ljpeg -lsndfile -lopenal -lGLEW -lglut
BOOST_LIB = -L/opt/libs/boost

And i've got output like this:

/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::setActive(bool)':
GlContext.cpp:(.text+0x2c): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x61): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x7d): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x9e): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `(anonymous namespace)::getInternalContext()':
GlContext.cpp:(.text+0xc2): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0xd4): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
GlContext.cpp:(.text+0xde): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x12a): undefined reference to `sf::Lock::~Lock()'
GlContext.cpp:(.text+0x150): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x1a4): undefined reference to `sf::ThreadLocal::setValue(void*)'
GlContext.cpp:(.text+0x1b1): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
GlContext.cpp:(.text+0x1bb): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x206): undefined reference to `sf::Lock::~Lock()'
GlContext.cpp:(.text+0x210): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x279): undefined reference to `sf::ThreadLocal::setValue(void*)'
GlContext.cpp:(.text+0x33f): undefined reference to `sf::Lock::~Lock()'
GlContext.cpp:(.text+0x352): undefined reference to `sf::Lock::~Lock()'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::globalInit()':
GlContext.cpp:(.text+0x3a9): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x3ff): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x419): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::create()':
GlContext.cpp:(.text+0x4a7): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x509): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::~GlContext()':
GlContext.cpp:(.text+0x56b): undefined reference to `sf::ThreadLocal::getValue() const'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::~GlContext()':
GlContext.cpp:(.text+0x5bb): undefined reference to `sf::ThreadLocal::getValue() const'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::create(sf::ContextSettings const&, sf::priv::WindowImpl const*, unsigned int)':
GlContext.cpp:(.text+0x617): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x64f): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x6c1): undefined reference to `sf::ThreadLocal::setValue(void*)'
GlContext.cpp:(.text+0x6f6): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x71d): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::ensureContext()':
GlContext.cpp:(.text+0x747): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x766): undefined reference to `sf::ThreadLocal::getValue() const'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::create(sf::ContextSettings const&, unsigned int, unsigned int)':
GlContext.cpp:(.text+0x7b7): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x7ef): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x861): undefined reference to `sf::ThreadLocal::setValue(void*)'
GlContext.cpp:(.text+0x896): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x8bd): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::initialize()':
GlContext.cpp:(.text+0x95a): undefined reference to `sf::ThreadLocal::getValue() const'
GlContext.cpp:(.text+0x9b9): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::globalCleanup()':
GlContext.cpp:(.text+0xa0b): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
GlContext.cpp:(.text+0xa83): undefined reference to `sf::Lock::~Lock()'
GlContext.cpp:(.text+0xa94): undefined reference to `sf::Lock::~Lock()'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::priv::GlContext::ensureContext()':
GlContext.cpp:(.text+0x786): undefined reference to `sf::ThreadLocal::setValue(void*)'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `sf::ThreadLocalPtr<sf::priv::GlContext>::~ThreadLocalPtr()':
GlContext.cpp:(.text._ZN2sf14ThreadLocalPtrINS_4priv9GlContextEED2Ev[_ZN2sf14ThreadLocalPtrINS_4priv9GlContextEED5Ev]+0x1): undefined reference to `sf::ThreadLocal::~ThreadLocal()'
/opt/libs/SFML/lib/libsfml-window-s.a(GlContext.cpp.o): In function `_GLOBAL__sub_I__ZN2sf4priv9GlContext10globalInitEv':
GlContext.cpp:(.text.startup+0xc): undefined reference to `sf::ThreadLocal::ThreadLocal(void*)'
GlContext.cpp:(.text.startup+0x2c): undefined reference to `sf::ThreadLocal::ThreadLocal(void*)'
GlContext.cpp:(.text.startup+0x94): undefined reference to `sf::Mutex::Mutex()'
GlContext.cpp:(.text.startup+0xa3): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-window-s.a(GlResource.cpp.o): In function `sf::GlResource::GlResource()':
GlResource.cpp:(.text+0xf): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
GlResource.cpp:(.text+0x37): undefined reference to `sf::Lock::~Lock()'
GlResource.cpp:(.text+0x50): undefined reference to `sf::Lock::~Lock()'
/opt/libs/SFML/lib/libsfml-window-s.a(GlResource.cpp.o): In function `sf::GlResource::~GlResource()':
GlResource.cpp:(.text+0x7f): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
GlResource.cpp:(.text+0xa1): undefined reference to `sf::Lock::~Lock()'
GlResource.cpp:(.text+0xb5): undefined reference to `sf::Lock::~Lock()'
/opt/libs/SFML/lib/libsfml-window-s.a(GlResource.cpp.o): In function `_GLOBAL__sub_I__ZN2sf10GlResourceC2Ev':
GlResource.cpp:(.text.startup+0xa): undefined reference to `sf::Mutex::Mutex()'
GlResource.cpp:(.text.startup+0x19): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-system-s.a(ClockImpl.cpp.o): In function `sf::priv::ClockImpl::getCurrentTime()':
ClockImpl.cpp:(.text+0xd): undefined reference to `clock_gettime'
/opt/libs/SFML/lib/libsfml-window-s.a(Window.cpp.o): In function `sf::Window::setActive(bool) const [clone .part.3]':
Window.cpp:(.text+0xb7): undefined reference to `sf::err()'
/opt/libs/SFML/lib/libsfml-window-s.a(Window.cpp.o): In function `sf::Window::display()':
Window.cpp:(.text+0x6aa): undefined reference to `sf::sleep(sf::Time)'
/opt/libs/SFML/lib/libsfml-window-s.a(Window.cpp.o): In function `sf::Window::create(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)':
Window.cpp:(.text+0x914): undefined reference to `sf::err()'
Window.cpp:(.text+0xa21): undefined reference to `sf::err()'
/opt/libs/SFML/lib/libsfml-window-s.a(WindowImpl.cpp.o): In function `sf::priv::WindowImpl::popEvent(sf::Event&, bool)':
WindowImpl.cpp:(.text+0x1247): undefined reference to `sf::sleep(sf::Time)'
/opt/libs/SFML/lib/libsfml-window-s.a(VideoModeImpl.cpp.o): In function `sf::priv::VideoModeImpl::getDesktopMode()':
VideoModeImpl.cpp:(.text+0x5a): undefined reference to `sf::err()'
VideoModeImpl.cpp:(.text+0x199): undefined reference to `sf::err()'
VideoModeImpl.cpp:(.text+0x1f1): undefined reference to `sf::err()'
/opt/libs/SFML/lib/libsfml-window-s.a(VideoModeImpl.cpp.o): In function `sf::priv::VideoModeImpl::getFullscreenModes()':
VideoModeImpl.cpp:(.text+0x28e): undefined reference to `sf::err()'
VideoModeImpl.cpp:(.text+0x47b): undefined reference to `sf::err()'
/opt/libs/SFML/lib/libsfml-window-s.a(VideoModeImpl.cpp.o):VideoModeImpl.cpp:(.text+0x4d1): more undefined references to `sf::err()' follow
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::Texture()':
Texture.cpp:(.text+0x7c): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x96): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0xae): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0xc7): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::create(unsigned int, unsigned int)':
Texture.cpp:(.text+0x20f): undefined reference to `sf::err()'
Texture.cpp:(.text+0x319): undefined reference to `sf::err()'
Texture.cpp:(.text+0x486): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x4a2): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x4f6): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x50f): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::loadFromImage(sf::Image const&, sf::Rect<int> const&) [clone .constprop.40]':
Texture.cpp:(.text+0x720): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x739): undefined reference to `sf::Mutex::~Mutex()'
Texture.cpp:(.text+0x74d): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x769): undefined reference to `sf::Lock::~Lock()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::Texture(sf::Texture const&)':
Texture.cpp:(.text+0xe09): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0xe26): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0xe46): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0xe5f): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::update(unsigned char const*)':
Texture.cpp:(.text+0xfbc): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0xfd8): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0xff6): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x100f): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::update(unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int)':
Texture.cpp:(.text+0x1116): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x1132): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x1156): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x116f): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::update(sf::Image const&)':
Texture.cpp:(.text+0x127c): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x1298): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x12b6): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x12cf): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::update(sf::Image const&, unsigned int, unsigned int)':
Texture.cpp:(.text+0x15f6): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x1612): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x1636): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x164f): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::update(sf::Window const&)':
Texture.cpp:(.text+0x1743): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x175f): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x1786): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x179f): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::update(sf::Window const&, unsigned int, unsigned int)':
Texture.cpp:(.text+0x18a5): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x18c1): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x18e6): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x18ff): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(Texture.cpp.o): In function `sf::Texture::operator=(sf::Texture const&)':
Texture.cpp:(.text+0x1c68): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x1c85): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x1d23): undefined reference to `sf::Lock::Lock(sf::Mutex&)'
Texture.cpp:(.text+0x1d3f): undefined reference to `sf::Lock::~Lock()'
Texture.cpp:(.text+0x1d86): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x1d9f): undefined reference to `sf::Mutex::~Mutex()'
Texture.cpp:(.text+0x1db6): undefined reference to `sf::Mutex::Mutex()'
Texture.cpp:(.text+0x1dcf): undefined reference to `sf::Mutex::~Mutex()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(GLCheck.cpp.o): In function `sf::priv::glCheckError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)':
GLCheck.cpp:(.text+0x9c): undefined reference to `sf::err()'
/opt/libs/SFML/lib/libsfml-graphics-s.a(GLCheck.cpp.o): In function `sf::priv::ensureGlewInit()':
GLCheck.cpp:(.text+0x47b): undefined reference to `sf::err()'
 

minirop

  • Sr. Member
  • ****
  • Posts: 254
    • View Profile
    • http://dev.peyj.com
Re: Can't compile my game
« Reply #1 on: October 13, 2012, 08:23:01 am »
and if you link in the right order ?
Quote
-lsfml-graphics -lsfml-window -lsfml-system

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Can't compile my game
« Reply #2 on: October 13, 2012, 11:59:32 am »
Quote
and if you link in the right order ?
... as explained in the tutorial :)
Laurent Gomila - SFML developer

grzesius

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Can't compile my game
« Reply #3 on: October 13, 2012, 12:56:41 pm »
thanks man ;) I didn't know that the order is importatnt ;)

Now I have another error :

error while loading shared libraries: libsfml-graphics.so.2: cannot open shared object file: No such file or directory

AlexxanderX

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • AlexanderX
Re: Can't compile my game
« Reply #4 on: October 13, 2012, 01:09:09 pm »
Maybe you didn't unpacked your libs write. When I unpacked with cmake I maked for Release and for Debug.
Here you can find my blog and tutorials about SFML - http://alexanderx.net/ (died...) - http://web.archive.org/web/20160110002847/http://alexanderx.net/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Can't compile my game
« Reply #5 on: October 13, 2012, 03:49:07 pm »
Quote
I didn't know that the order is importatnt
That's why I write tutorials...

Quote
Now I have another erro
The library loader cannot find the libraries, which means that it doesn't know the directory where they are. Google "LD_LIBRARY_PATH" for more details.
Laurent Gomila - SFML developer

grzesius

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Can't compile my game
« Reply #6 on: October 14, 2012, 12:47:58 pm »
I just made link do libraries in /usr/lib and work :) thanks for help

 

anything