SFML - Fonts Fehler. LNK2019 gleicher wie bei Sprites

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • SFML - Fonts Fehler. LNK2019 gleicher wie bei Sprites

    Hay! Ich habe jetzt eine Font-Klasse geschrieben, damit ich kein Image nutzen muss.
    Jetzt kommt wie bei den Sprites der gleiche Fehler heraus. Doch ich habe doch Pointer und Referenzen genutzt, oder?

    Quellcode

    1. class DLL_GRAPHIC_API Font
    2. {
    3. public:
    4. void Init(const string Filename, sf::Font &Font, unsigned int Size, const string ttf);
    5. void Color(sf::String &String, int R, int G, int B);
    6. void Size(sf::String &String, float Size);
    7. void Position(sf::String &String, float x, float y);
    8. void Rotation(sf::String &String, float angle);
    9. void ttf(sf::String &String, sf::Font &Font);
    10. void Text(sf::String &String, const string Text);
    11. void SetStyle(sf::String &String, bool bold, bool italic, bool underlined);
    12. void Move(sf::String &Sring, float x, float y);
    13. void Render(sf::String &String, sf::RenderWindow App);
    14. private:
    15. sf::Font *Fonts;
    16. sf::String *String;
    17. };
    Alles anzeigen


    Quellcode

    1. void lwtGraphic::Font::Init(const string Filename, sf::Font &Fonts, unsigned int Size, const string ttf)
    2. {
    3. if(!Fonts.LoadFromFile(Filename, Size, ttf))
    4. exit (3);
    5. }
    6. void lwtGraphic::Font::Color(sf::String &String, int R, int G, int B)
    7. {
    8. String.SetColor(sf::Color(R, G, B));
    9. }
    10. void lwtGraphic::Font::Size(sf::String &String, float Size)
    11. {
    12. String.SetSize(Size);
    13. }
    14. void lwtGraphic::Font::Position(sf::String &String, float x, float y)
    15. {
    16. String.SetPosition(x, y);
    17. }
    18. void lwtGraphic::Font::Rotation(sf::String &String, float angle)
    19. {
    20. String.Rotate(angle);
    21. }
    22. void lwtGraphic::Font::Text(sf::String &String, const string Text)
    23. {
    24. String.SetText(Text);
    25. }
    26. void lwtGraphic::Font::ttf(sf::String &String, sf::Font &Fonts)
    27. {
    28. String.SetFont(Fonts);
    29. }
    30. void lwtGraphic::Font::SetStyle(sf::String &String, bool bold, bool italic, bool underlined)
    31. {
    32. String.SetStyle(sf::String::Regular);
    33. if(bold==true)
    34. String.SetStyle(sf::String::Bold);
    35. if(italic==true)
    36. String.SetStyle(sf::String::Italic);
    37. if(underlined==true)
    38. String.SetStyle(sf::String::Underlined);
    39. }
    40. void lwtGraphic::Font::Move(sf::String &String, float x, float y)
    41. {
    42. String.Move(x, y);
    43. }
    44. void lwtGraphic::Font::Render(sf::String &String, sf::RenderWindow App)
    45. {
    46. App.Draw(String);
    47. }
    Alles anzeigen


    MfG
    Check

  • Linkertoolfehler LNK2019:
    Verweis auf nicht aufgelöstes externes Symbol 'Symbol' in Funktion 'Funktion'
    unresolved external symbol 'symbol' referenced in function 'function'


    Vergessen externe Bibliotheken (*.lib) richtig zu velrinken?

    //Edit:
    Warum definierst du noch private Membervariablen (Fonts, String) wenn du diese nicht benutzt und dazu noch gleich der Memberfunktionsparameter nennst, das kann zu unklarheit führen.
    Und pass auf das du die Bezeichner in dekleration und definition gleich benennst!!!!!! ->

    void Init(const string Filename, sf::Font &Font, unsigned int Size, const string ttf);
    ...
    void lwtGraphic::Font::Init(const string Filename, sf::Font &Fonts, unsigned int Size, const string ttf)



    Mfg Rushh0ur

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Rushh0ur ()