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

Author Topic: Unresolved External using sf::Font  (Read 2497 times)

0 Members and 1 Guest are viewing this topic.

amandaGB

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unresolved External using sf::Font
« on: July 25, 2018, 01:14:41 pm »
Hey! I'm beginner in SFML, reading Haller's "SFML Game Development" now
and I got stuck in Chapter 5. Everything was running fine until here.
There was no problem using any other class (e.g. Shape, RenderWindow, RectangleShape)
But when using sf::Fonts I get the following error:

1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function "public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Done_FreeType referenced in function "private: void __thiscall sf::Font::cleanup(void)" (?cleanup@Font@sf@@AAEXXZ)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_New_Face referenced in function "public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_New_Memory_Face referenced in function "public: bool __thiscall sf::Font::loadFromMemory(void const *,unsigned int)" (?loadFromMemory@Font@sf@@QAE_NPBXI@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Open_Face referenced in function "public: bool __thiscall sf::Font::loadFromStream(class sf::InputStream &)" (?loadFromStream@Font@sf@@QAE_NAAVInputStream@2@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Done_Face referenced in function "public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Set_Pixel_Sizes referenced in function "private: bool __thiscall sf::Font::setCurrentSize(unsigned int)const " (?setCurrentSize@Font@sf@@ABE_NI@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Load_Char referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Get_Kerning referenced in function "public: float __thiscall sf::Font::getKerning(unsigned int,unsigned int,unsigned int)const " (?getKerning@Font@sf@@QBEMIII@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Select_Charmap referenced in function "public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Get_Char_Index referenced in function "public: float __thiscall sf::Font::getKerning(unsigned int,unsigned int,unsigned int)const " (?getKerning@Font@sf@@QBEMIII@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_MulFix referenced in function "public: float __thiscall sf::Font::getUnderlinePosition(unsigned int)const " (?getUnderlinePosition@Font@sf@@QBEMI@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Get_Glyph referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Glyph_To_Bitmap referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Done_Glyph referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Outline_Embolden referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Bitmap_Embolden referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Stroker_New referenced in function "public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Stroker_Set referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Stroker_Done referenced in function "public: bool __thiscall sf::Font::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadFromFile@Font@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-graphics-s-d.lib(Font.cpp.obj) : error LNK2019: unresolved external symbol _FT_Glyph_Stroke referenced in function "private: class sf::Glyph __thiscall sf::Font::loadGlyph(unsigned int,unsigned int,bool,float)const " (?loadGlyph@Font@sf@@ABE?AVGlyph@2@II_NM@Z)

I believe that I've setup the static library correctly (because there were no other errors up to now):: https://imgur.com/a/QCTRKUE

In Release Mode->Additional Dependencies:
sfml-graphics-s.lib
sfml-window-s.lib
sfml-audio-s.lib
sfml-network-s.lib
sfml-system-s.lib
opengl32.lib
winmm.lib
gdi32.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib
ws2_32.lib

In Debug Mode->Additional Dependencies:
sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-audio-s-d.lib
sfml-network-s-d.lib
sfml-system-s-d.lib
opengl32.lib
winmm.lib
gdi32.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib
ws2_32.lib

I appreciate any help! Thanks :)


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unresolved External using sf::Font
« Reply #1 on: July 25, 2018, 01:17:26 pm »
As the name of the functions highly suggest, and as written in the "Getting started" tutorial, you need to link to FreeType too ;)
Laurent Gomila - SFML developer

amandaGB

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unresolved External using sf::Font
« Reply #2 on: July 25, 2018, 01:30:37 pm »
As the name of the functions highly suggest, and as written in the "Getting started" tutorial, you need to link to FreeType too ;)

 Sorry, that fixed the issue :-X Now I'll check if I didn't forgot any other dependencies...Thanks a lot!  :D