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

Author Topic: Build Problem  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

mhmudfadel

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Build Problem
« on: December 24, 2013, 06:12:07 pm »
Hi  :)
Now, I'm trying build my first application using SFML, i'm using VS 2012 with SFML version SFML-2.1-windows-vc11-64bits, i achived first SFML tutorial for VS but the console gave me error:
Quote
1>------ Rebuild All started: Project: Win32Project1, Configuration: Debug Win32 ------
1>  main.cpp
1>main.obj : 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
1>main.obj : 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
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::close(void)" (?close@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::isOpen(void)const " (?isOpen@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : 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
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::display(void)" (?display@Window@sf@@QAEXXZ) 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: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (?clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>main.obj : 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
1>main.obj : 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
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::Shape::~Shape(void)" (??1Shape@sf@@UAE@XZ) referenced in function "public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (??1CircleShape@sf@@UAE@XZ)
1>main.obj : 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
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (??0CircleShape@sf@@QAE@MI@Z) referenced in function _main
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\dell-inspiron\documents\visual studio 2012\Projects\Win32Project1\Debug\Win32Project1.exe : fatal error LNK1120: 17 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Mark

  • Guest
Re: Build Problem
« Reply #1 on: December 24, 2013, 06:25:47 pm »
First of all, this topic should be moved to help section, more specifically, between the general help topics.

Have you followed this tutorial correctly? http://www.sfml-dev.org/tutorials/2.0/start-vc.php
Errors like these happen when you're not linking your project with a library that contains the definition of a function you're using from that library. Check these out:

« Last Edit: December 24, 2013, 06:28:45 pm by Mark »

mhmudfadel

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Build Problem
« Reply #2 on: December 25, 2013, 11:38:57 am »
All these settings like my settings except the version of SFML, here you used SFML v2.0, But I used SFML v2.1 is this the mistake ?

Mark

  • Guest
Re: Build Problem
« Reply #3 on: December 25, 2013, 07:12:30 pm »
No, it's definitely not. Try downloading the 32-bit package instead. And, have you defined SFML_STATIC macro in the preprocessor options of your project? (you shouldn't)
« Last Edit: December 25, 2013, 07:16:37 pm by Mark »

 

anything