Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Quellcode |
|
1 2 |
1>main.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA)". 1>C:\Users\Justus\Documents\Visual Studio 2008\Projects\SFML\Debug\SFML.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise. |
Quellcode |
|
1 2 3 4 5 |
SFML-Audio-d.lib SFML-System-d.lib SFML-Graphics-d.lib SFML-Network-d.lib SFML-Window -d.lib |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
//////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <SFML/Graphics.hpp> //////////////////////////////////////////////////////////// /// Entry point of application /// /// \return Application exit code /// //////////////////////////////////////////////////////////// int main() { // Create main window sf::RenderWindow App(sf::VideoMode(800, 600), "SFML Fonts"); // Load a font from a file sf::Font MyFont; if (!MyFont.LoadFromFile("comic.ttf", 50)) return EXIT_FAILURE; // Create a graphical string sf::String Hello; Hello.SetText("Hello !\nHow are you ?"); Hello.SetFont(MyFont); Hello.SetColor(sf::Color(0, 128, 128)); Hello.SetPosition(100.f, 100.f); Hello.SetRotation(15.f); Hello.SetSize(50.f); // You can also use the constructor sf::String Bonjour("Salut !\nComment ça va ?", sf::Font::GetDefaultFont(), 30.f); Bonjour.SetColor(sf::Color(200, 128, 0)); Bonjour.SetPosition(200.f, 300.f); // Start game loop while (App.IsOpened()) { // Process events sf::Event Event; while (App.GetEvent(Event)) { // Close window : exit if (Event.Type == sf::Event::Closed) App.Close(); } // Make the second string rotate Bonjour.Rotate(App.GetFrameTime() * 100.f); // Clear screen App.Clear(); // Draw our strings App.Draw(Hello); App.Draw(Bonjour); // Finally, display rendered frame on screen App.Display(); } return EXIT_SUCCESS; } |
Werbeanzeige