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

Author Topic: Errors while setting up SFML 2.1  (Read 7403 times)

0 Members and 2 Guests are viewing this topic.

svante112

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Errors while setting up SFML 2.1
« on: August 19, 2013, 05:45:18 pm »
Hello!

Ive just tried setting up a project that are going to use SFML 2.1

I followed the tutorial on SFML website but i get alot of errors when i try to run it.

Errors looks like this
Error   18      error LNK1120: 17 unresolved externals  c:\users\admin\documents\visual studio 2012\Projects\SFML 2.1 game\Debug\SFML 2.1 game.exe      SFML 2.1 game
Error   15      error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)     c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   16      error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)    c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   14      error LNK2019: unresolved external symbol "public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (??0CircleShape@sf@@QAE@MI@Z) referenced in function _main      c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   7       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 c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   10      error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _main    c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   1       error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(char const *,class std::locale const &)" (??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _main c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   2       error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main       c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   4       error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::isOpen(void)const " (?isOpen@Window@sf@@QBE_NXZ) referenced in function _main    c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   5       error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main    c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   11      error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main  c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   12      error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Shape::~Shape(void)" (??1Shape@sf@@UAE@XZ) referenced in function "public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (??1CircleShape@sf@@UAE@XZ)        c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   8       error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (?clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main   c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   9       error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z) referenced in function _main      c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   13      error LNK2019: unresolved external symbol "public: void __thiscall sf::Shape::setFillColor(class sf::Color const &)" (?setFillColor@Shape@sf@@QAEXABVColor@2@@Z) referenced in function _main   c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   3       error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::close(void)" (?close@Window@sf@@QAEXXZ) referenced in function _main     c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   6       error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::display(void)" (?display@Window@sf@@QAEXXZ) referenced in function _main c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\main.obj       SFML 2.1 game
Error   17      error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\MSVCRTD.lib(crtexew.obj)       SFML 2.1 game

 

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Errors while setting up SFML 2.1
« Reply #1 on: August 19, 2013, 05:48:37 pm »
You link SFML in a wrong way (or not at all). Please read the sections about linking carefully again.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:


Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Errors while setting up SFML 2.1
« Reply #3 on: August 19, 2013, 08:07:28 pm »
Yes, because you didn't read carefully ::)

SFML_STATIC must match the libraries' -s suffix.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

svante112

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Errors while setting up SFML 2.1
« Reply #4 on: August 19, 2013, 08:22:43 pm »
Yes, because you didn't read carefully ::)

SFML_STATIC must match the libraries' -s suffix.

Ops that fixed most of the error  ;D

Still got one error saying

error LNK1112: module machine type'x64' conflicts with target machine type 'X86'

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Errors while setting up SFML 2.1
« Reply #5 on: August 19, 2013, 08:25:08 pm »
You're using a 64-bits SFML with a 32-bits compiler.
Laurent Gomila - SFML developer

svante112

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Errors while setting up SFML 2.1
« Reply #6 on: August 19, 2013, 09:03:06 pm »
You're using a 64-bits SFML with a 32-bits compiler.

Thanks im so stupid ^^

I downloaded the 32 bit and now its says
Error   2       error LNK1120: 1 unresolved externals   c:\users\admin\documents\visual studio 2012\Projects\SFML 2.1 game\Release\SFML 2.1 game.exe    1       1       SFML 2.1 game
Error   1       error LNK2001: unresolved external symbol _WinMain@16   c:\Users\Admin\documents\visual studio 2012\Projects\SFML 2.1 game\SFML 2.1 game\MSVCRT.lib(crtexew.obj)        SFML 2.1 game
 
I´m really glad you are helping me :)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Errors while setting up SFML 2.1
« Reply #7 on: August 19, 2013, 09:10:55 pm »
Link to sfml-main. And seriously, RTFM >:(
« Last Edit: August 19, 2013, 09:13:13 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

svante112

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Errors while setting up SFML 2.1
« Reply #8 on: August 19, 2013, 09:18:48 pm »
Link to sfml-main. And seriously, RTFM >:(

I read this
http://www.sfml-dev.org/tutorials/2.1/start-vc.php
 and i cant find that :p

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Errors while setting up SFML 2.1
« Reply #9 on: August 19, 2013, 09:24:55 pm »
Quote
I read this
http://www.sfml-dev.org/tutorials/2.1/start-vc.php
 and i cant find that :p
Fortunately your computer is smarter than you :P
--> Ctrl + F, "sfml-main"
Laurent Gomila - SFML developer

svante112

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Errors while setting up SFML 2.1
« Reply #10 on: August 19, 2013, 09:26:17 pm »
Link to sfml-main. And seriously, RTFM >:(
Can you link a page where i can read all that?

svante112

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Errors while setting up SFML 2.1
« Reply #11 on: August 19, 2013, 09:26:55 pm »
Quote
I read this
http://www.sfml-dev.org/tutorials/2.1/start-vc.php
 and i cant find that :p
Fortunately your computer is smarter than you :P
--> Ctrl + F, "sfml-main"
Thanks! :D