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

Author Topic: Error SFML  (Read 4749 times)

0 Members and 1 Guest are viewing this topic.

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Error SFML
« on: August 05, 2018, 01:20:06 am »
Hello. I follow step by step this tutorial: https://www.sfml-dev.org/tutorials/2.5/start-vc.php again and again and again. I have a problem when i press Local Windows Debugger. If i build it's work. If i press Local Windows Debugger i take this:
(click to show/hide)

How can i fix? I'm begginer to programming.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error SFML
« Reply #1 on: August 05, 2018, 12:19:17 pm »
If you get linker errors, then building doesn't actually work. The errors get listed in the error window, but sometimes the window gets hidden.

What's your verbose build command? https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #2 on: August 05, 2018, 06:57:27 pm »
I have Visual Studio 2017.
SFML version 2.5.0 64 bit: Visual C++ 15 (2017) - 64-bit
SETTING:
https://imgur.com/W7Nd1RN
https://imgur.com/zXYOV5P
https://imgur.com/LdwAGeS
https://imgur.com/VTJ3Z6S
https://imgur.com/Jqehfwy
https://imgur.com/bKaUdsB
https://imgur.com/oiuc07v

and when i create new project i select:  new project -> visual c++ -> windows desktop -> windows desktop wizard > empy project.
what is wrong?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error SFML
« Reply #3 on: August 05, 2018, 07:19:51 pm »
The tutorial states that you should define SFML_STATIC only if you link SFML statically, yet you define it and link SFML dynamically. ;)

See that "Debug" and "x86" next to "Local Windows Debugger"? That means you'll run your application as x86 and not x64, which will most likely cause issues, as you didn't configure the x86 target, nor are you using 32bits SFML libraries.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #4 on: August 05, 2018, 07:29:52 pm »
So, i will remove SFML_STATIC, i will try x64, same problem

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error SFML
« Reply #5 on: August 05, 2018, 07:55:19 pm »
So where's the verbose output I asked you about? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #6 on: August 05, 2018, 08:01:10 pm »
I do not know exactly, you can be more explicit? I imput all file from VS library standard and SFML library, but output... i don't know

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error SFML
« Reply #7 on: August 05, 2018, 08:02:26 pm »
See that link I posted above? Did you click it and read that section of the FAQ? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #8 on: August 05, 2018, 08:07:40 pm »
OUTPUT:
Code: [Select]
1>------ Build started: Project: Test32, Configuration: Debug x64 ------
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QEAA@PEBDAEBVlocale@std@@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl sf::String::~String(void)" (__imp_??1String@sf@@QEAA@XZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QEAA@III@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::Window::close(void)" (__imp_?close@Window@sf@@QEAAXXZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QEBA_NXZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QEAA_NAEAVEvent@2@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::Window::display(void)" (__imp_?display@Window@sf@@QEAAXXZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (__imp_??0Color@sf@@QEAA@EEEE@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::Shape::setFillColor(class sf::Color const &)" (__imp_?setFillColor@Shape@sf@@QEAAXAEBVColor@2@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl sf::CircleShape::CircleShape(float,unsigned __int64)" (__imp_??0CircleShape@sf@@QEAA@M_K@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl sf::CircleShape::~CircleShape(void)" (__imp_??1CircleShape@sf@@UEAA@XZ) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::RenderTarget::clear(class sf::Color const &)" (__imp_?clear@RenderTarget@sf@@QEAAXAEBVColor@2@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (__imp_?draw@RenderTarget@sf@@QEAAXAEBVDrawable@2@AEBVRenderStates@2@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QEAA@VVideoMode@1@AEBVString@1@IAEBUContextSettings@1@@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UEAA@XZ) referenced in function main
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class sf::RenderStates const sf::RenderStates::Default" (__imp_?Default@RenderStates@sf@@2V12@B)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class sf::Color const sf::Color::Green" (__imp_?Green@Color@sf@@2V12@B)
1>C:\Users\Claudiu\source\repos\Test32\x64\Debug\Test32.exe : fatal error LNK1120: 17 unresolved externals
1>Done building project "Test32.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
i will read, i will follow, this is output
« Last Edit: August 05, 2018, 08:10:54 pm by WiDuAlK »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error SFML
« Reply #9 on: August 05, 2018, 09:14:39 pm »
Doesn't contain the build command, so make sure you read and follow carefully.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #10 on: August 05, 2018, 09:20:56 pm »

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #11 on: August 05, 2018, 09:22:22 pm »
I have Team Viewer 13 if you want to make again new project. I just want to solve that to learn better C++ and develope new mini-aplication...

WiDuAlK

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Error SFML
« Reply #12 on: August 05, 2018, 11:15:19 pm »
Problem Solved , thank you eXpl0it3r!!!!