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

Author Topic: VS2005 Build Error  (Read 2866 times)

0 Members and 1 Guest are viewing this topic.

SnowMoo

  • Newbie
  • *
  • Posts: 3
    • View Profile
VS2005 Build Error
« on: August 09, 2008, 08:58:54 am »
Hello,

I am new to SFML and I am trying out the tutorials on the web.. However, there is some errors when I build the codes

the code
Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Change background color to red
    App.SetBackgroundColor(sf::Color(200, 0, 0));

    // 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();

            // A key has been pressed
            if (Event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (Event.Key.Code == sf::Key::Escape)
                    App.Close();

                // F1 key : capture a screenshot
                if (Event.Key.Code == sf::Key::F1)
                {
                    sf::Image Screen = App.Capture();
                    Screen.SaveToFile("screenshot.jpg");
                }
            }
        }

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


Errors
Code: [Select]

1>Main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Image::~Image(void)" (??1Image@sf@@UAE@XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Image::SaveToFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?SaveToFile@Image@sf@@QBE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: class sf::Image __thiscall sf::RenderWindow::Capture(void)const " (?Capture@RenderWindow@sf@@QBE?AVImage@2@XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderWindow::SetBackgroundColor(class sf::Color const &)" (?SetBackgroundColor@RenderWindow@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VS2005 Build Error
« Reply #1 on: August 09, 2008, 11:44:06 am »
Apparently you didn't link to sfml-graphics.
Laurent Gomila - SFML developer

SnowMoo

  • Newbie
  • *
  • Posts: 3
    • View Profile
VS2005 Build Error
« Reply #2 on: August 09, 2008, 01:40:01 pm »
oic.. thanks.. problem solved..

 

anything