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

Author Topic: SFML1.6 error  (Read 1847 times)

0 Members and 1 Guest are viewing this topic.

Wooowe

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML1.6 error
« on: September 30, 2012, 09:05:58 pm »
Hey guys this very odd error has come up on my ubuntu machine for the past couple of day, been trying to figure it.

The error is when I am trying to run the SFML program:
./main: symbol lookup error: /usr/local/lib/libsfml-window.so.1.6: undefined symbol: _ZN2sf7Unicode17UTF8TrailingBytesE

this is how I compile it:
g++ -o main main.o -lsfml-graphics -lsfml-window -lsfml-system


P.S this only happens when I try to render a window, it is all good when I did that starting program in the gcc tutorial section

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML1.6 error
« Reply #1 on: September 30, 2012, 11:08:49 pm »
Did you install other versions of SFML?
Laurent Gomila - SFML developer

Wooowe

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML1.6 error
« Reply #2 on: October 01, 2012, 05:01:58 am »
I haven't tried any other versions yet, but I also get the same type of error when I do SDL stuff.

Wooowe

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML1.6 error
« Reply #3 on: October 02, 2012, 02:41:28 am »
Just installed 2.0 that error is gone but I get a new one:
/tmp/cc3VtzXx.o:test.cpp:function main: error: undefined reference to 'sf::Window::create(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)'
collect2: ld returned 1 exit status

I put in the same terminal commands as always

Wooowe

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML1.6 error
« Reply #4 on: October 02, 2012, 03:05:07 am »
Just got it all to work, seems like I couldn't just drag the files into usr/local/include & lib? I had to to that long process "g++ -c main.cpp -I/home/me/SFML-2.0-rc/include"

Can you please tell me how to correctly install v2.0 so I don't have to do that super long command xD?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML1.6 error
« Reply #5 on: October 02, 2012, 07:54:53 am »
If you had to do that, it means that the compiler found and chose another include path containing SFML headers. Make sure that other versions of SFML don't conflict with the one that you use (remove everything that you don't need anymore!).
Laurent Gomila - SFML developer

Wooowe

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML1.6 error
« Reply #6 on: October 04, 2012, 01:19:11 am »
Yep had to install the SFML 2.0 lib / include in my /usr/ folder, but now I am getting an error where the GL/gl.h .. ect files aren't being found because when I compile my programs it says :

/tmp/ccwSbe6q.o:test.cpp:function main: error: undefined reference to 'glViewport'
/tmp/ccwSbe6q.o:test.cpp:function main: error: undefined reference to 'glClear'
collect2: ld returned 1 exit status


Does this mean I have to reinstall OpenGL and hope for the best?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML1.6 error
« Reply #7 on: October 04, 2012, 07:59:51 am »
You have to link to OpenGL (-lGL) if you use it.
Laurent Gomila - SFML developer

Wooowe

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML1.6 error
« Reply #8 on: October 06, 2012, 02:12:20 am »
Lol I feel stupid now xD, thanks for all the help! SFML looks very promising :D!

 

anything