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

Author Topic: Font linker error with static linking  (Read 1549 times)

0 Members and 1 Guest are viewing this topic.

Elit3d

  • Newbie
  • *
  • Posts: 3
    • View Profile
Font linker error with static linking
« on: April 29, 2019, 08:42:36 pm »
Quote
Severity   Code   Description   Project   File   Line   Suppression State
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
Error   LNK2019   unresolved external symbol _FT_Done_FreeType referenced in function "private: void __thiscall sf::Font::cleanup(void)" (?cleanup@Font@sf@@AAEXXZ)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
Error   LNK2019   unresolved external symbol _FT_Get_Char_Index referenced in function "public: class sf::Glyph const & __thiscall sf::Font::getGlyph(unsigned int,unsigned int,bool,float)const " (?getGlyph@Font@sf@@QBEABVGlyph@2@II_NM@Z)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
Error   LNK2019   unresolved external symbol _FT_MulFix referenced in function "public: float __thiscall sf::Font::getUnderlinePosition(unsigned int)const " (?getUnderlinePosition@Font@sf@@QBEMI@Z)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
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)   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\rpg2d\sfml-graphics-s-d.lib(Font.cpp.obj)   1   
Error   LNK1120   21 unresolved externals   rpg2d   C:\Users\Kyle\Documents\my rpg game [WIP]\rpg2d\Debug\rpg2d.exe   1   

So everything works fine in my game before using font so i feel like i linked everything correctly though the font just breaks my game and wont let me load it due to the linker error. Any ideas on how to fix this?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Font linker error with static linking
« Reply #1 on: April 29, 2019, 09:22:40 pm »
You aren't linking freetype as mentioned in the tutorials. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Elit3d

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Font linker error with static linking
« Reply #2 on: April 30, 2019, 03:10:14 am »
You aren't linking freetype as mentioned in the tutorials. ;)

Oh wow ;D I completely overlooked that. Thank you!