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

Author Topic: Linker error when loading font  (Read 2317 times)

0 Members and 1 Guest are viewing this topic.

Neomex

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Linker error when loading font
« on: December 31, 2011, 12:34:11 pm »
Hello,
I'm just simply loading font as it was written in 1.6 tutorial

Code: [Select]

namespace Path
{
static const string Fonts      = "Data//Fonts//";
}

sf::Font RobotFont;

if( !RobotFont.LoadFromFile( Path::Fonts + "homemade-robot-italic.ttf", 30 ) )
Error = true;

sf::String Text( "Initialising program...", RobotFont, 30 );



And that's what I get:
Code: [Select]

1>App.obj : error LNK2001: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA)
1>C:\Users\Olek\Desktop\SFML\Debug\SFML.exe : fatal error LNK1120: 1 unresolved externals


When I try to give him random charset, it launches but font isn't loaded. (returns -1)
Drawing primitives / sprites works properly.

I'm using windows, MVC++ 2008 and SFML 1.6
---
Just noticed:
Something like sf::Color(r,g,b) works,
but with sf::Color::Green I get linker error:
Code: [Select]

1>App.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linker error when loading font
« Reply #1 on: December 31, 2011, 12:59:52 pm »
Define SFML_DYNAMIC.
Laurent Gomila - SFML developer

Neomex

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Linker error when loading font
« Reply #2 on: December 31, 2011, 01:09:47 pm »
Right, quite big oversight  :)
Thanks

 

anything