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

Author Topic: Stupid question about strings  (Read 1930 times)

0 Members and 1 Guest are viewing this topic.

declan

  • Newbie
  • *
  • Posts: 34
    • View Profile
Stupid question about strings
« on: June 03, 2010, 08:12:03 pm »
Hi everyone. I'm just trying to write some text on the screen. From reading the tutorials I'm doing this:

Code: [Select]

sf::String Lowertext("0", sf::Font::GetDefaultFont(), 50);


and I have #include <SFML/Graphics.hpp> at the top of my file. I'm compiling with -framework sfml-graphics and -framework sfml-window (I'm using OSX).

However, I'm getting the error:

Code: [Select]
Undefined symbols:
  "sf::Unicode::Text::Text(char const*)", referenced from:
      flowfield(int, int, int, int, int, Matrix3d&)in flowfield.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


This leads me to think that I'm not including the right package or something, or maybe I need to have another #include..? Could someone point me in the right direction?

Thanks!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Stupid question about strings
« Reply #1 on: June 03, 2010, 08:36:45 pm »
Simply add -framework sfml-system ;)
Laurent Gomila - SFML developer

declan

  • Newbie
  • *
  • Posts: 34
    • View Profile
Stupid question about strings
« Reply #2 on: June 03, 2010, 08:49:12 pm »
Haha, durrr. Knew I was missing something simple, but I thought sf::String was part of sf::Drawable, which was part of sf::Graphics, or something.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Stupid question about strings
« Reply #3 on: June 03, 2010, 09:08:56 pm »
Yes it is, but it depends on the lower-level sf::Unicode, which is part of sfml-system.

Basically, all SFML modules depend on sfml-system. It should even be named sfml-core, in fact.
Laurent Gomila - SFML developer