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

Author Topic: Font Linking  (Read 1530 times)

0 Members and 1 Guest are viewing this topic.

FrozenKiller

  • Newbie
  • *
  • Posts: 5
    • MSN Messenger - FrozenKiller42@gmail.com
    • View Profile
Font Linking
« on: September 20, 2010, 12:24:34 pm »
Hello

I am trying to add some simple text to my game, but it seems I can't call Font::LoadFromFile(). My compiler gives me this:
Code: [Select]

error LNK2001: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA)


I am linking with all the debug .lib files in VC++ 10 Express.

TIA

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Font Linking
« Reply #1 on: September 20, 2010, 12:29:10 pm »
You must define SFML_DYNAMIC when linking to the dynamic SFML libraries.
Laurent Gomila - SFML developer

FrozenKiller

  • Newbie
  • *
  • Posts: 5
    • MSN Messenger - FrozenKiller42@gmail.com
    • View Profile
Font Linking
« Reply #2 on: September 20, 2010, 12:56:14 pm »
Thank you.

That got me past the compile stage, now I get a Access Violation at the following line in Font.cpp

Code: [Select]

unsigned int Font::GetCharacterSize() const
{
    return myCharSize;
}


TIA

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Font Linking
« Reply #3 on: September 20, 2010, 01:10:34 pm »
Can you show your complete code?
Laurent Gomila - SFML developer

FrozenKiller

  • Newbie
  • *
  • Posts: 5
    • MSN Messenger - FrozenKiller42@gmail.com
    • View Profile
Font Linking
« Reply #4 on: September 20, 2010, 01:59:35 pm »
I seem to have fixed it by my self. My Init() method was not quite right.

Thanks for your help.  :D  :D