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

Author Topic: Unresolved External Symbols  (Read 2778 times)

0 Members and 1 Guest are viewing this topic.

G_Freak45

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unresolved External Symbols
« on: April 09, 2012, 04:19:09 am »
Hi there, so I just installed everything and the test worked correctly, which was the clock test example they gave in the Win32 VS2008 instructions.  Originally that had issues with compiling then requiring the sfml-system.dll file which was fixed via copy/pasting into the project's directory.

However, when i opened an empty normal win32 application and did the following:
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

int main()
{
        sf::RenderWindow App (sf::VideoMode(800, 600, 32), "MyApp", sf::Style::Fullscreen);
        while (App.IsOpened()) App.Display();

        system("Pause");
        return 0;
}

I got the following errors:
Code: [Select]
1>------ Build started: Project: SFML Test, Configuration: Debug Win32 ------
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::IsOpened(void)const " (__imp_?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 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 &)" (__imp_??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
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\debbie\Desktop\Documents\Visual Studio 2010\Projects\SFML Test\Debug\SFML Test.exe : fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
« Last Edit: April 09, 2012, 10:11:34 am by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Unresolved External Symbols
« Reply #1 on: April 09, 2012, 10:12:08 am »
You must link to sfml-window and sfml-graphics.
Laurent Gomila - SFML developer