SFML community forums

Help => Graphics => Topic started by: Neomex on December 31, 2011, 12:34:11 pm

Title: Linker error when loading font
Post by: Neomex 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)
Title: Linker error when loading font
Post by: Laurent on December 31, 2011, 12:59:52 pm
Define SFML_DYNAMIC.
Title: Linker error when loading font
Post by: Neomex on December 31, 2011, 01:09:47 pm
Right, quite big oversight  :)
Thanks