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

Author Topic: having trouble with running window code in windows 2013 ultimate_udemy tutorial6  (Read 3101 times)

0 Members and 1 Guest are viewing this topic.

ApacheOmega

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
High I'm confused with the initial setup because there is no sfml sources folder its just sfml. I've already gotten to lesson 6 and when I ran the code I got this error message ----
Quote
Error1error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _mainc:\Users\apacheomega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\Main.obj1stCppGame

Error2error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) referenced in function _mainc:\Users\apacheomega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\Main.obj1stCppGame

Error3error 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 _mainc:\Users\apacheomega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\Main.obj1stCppGame

Error4error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _mainc:\Users\apacheomega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\Main.obj1stCppGame

Error5error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _mainc:\Users\apacheomega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\Main.obj1stCppGame

Error6error LNK1120: 5 unresolved externalsc:\users\apacheomega\documents\visual studio 2013\Projects\1stCppGame\Debug\1stCppGame.exe1stCppGame
What am I possibly doing wrong? How Can I fix this error?

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Try the official SFML tutorials instead: http://www.sfml-dev.org/tutorials/2.2/

All I can say without more information is those linker errors probably mean you aren't linking against the system and graphics modules.

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
My guess is that you're not linking against SFML libraries. (sfml-graphics, etc.)
And I (we?) don't know what tutorial 6 is. More info on setting up SFML for your IDE/compiler in the official tutorial.

ApacheOmega

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Thanks for the reply fellas
the tutorial I'm using is from the udemy tutorial site and the tutorial is called [ learn C++ Game Development by Luka Horvat] i later tried another example code and then I got this message

Error   1   error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'   C:\Users\ApacheOmega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\sfml-graphics-d.lib(sfml-graphics-d-2.dll)   1stCppGame

not sure whats going on but I'm turning my attention to the official site like you both have recomended.


Thanks Again
AO!


Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
That error appears to mean you're using a 64-bit ("x64") library with a 32-bit ("x86") compiler, though I'm not quite sure.  It's definitely a 32/64 conflict of some kind.

The official tutorials are probably the only reliable way to get your toolchain set up to actually work correctly. Most other sources gloss over it entirely (since most devs need to know this stuff already) or get it blatantly wrong or provide info that's only appropriate for their particular machines.

ApacheOmega

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Ixrec Thanks
now that I followed the official I dont get that error anymore but the new error I get now is this ---
Quote
Error   1   error LNK1104: cannot open file 'sfml-opengl32-s-d.lib'   C:\Users\ApacheOmega\documents\visual studio 2013\Projects\1stCppGame\1stCppGame\LINK   1stCppGame

now when I look in the sfml folder I installed I don't see any opengl lib or dll.
do I need to download openGL?

Thanks
AO!

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
sfml-opengl32-s-d is not a library that exists, because OpenGL is not part of SFML itself, but a dependency of SFML.  As the official tutorial states, the name of the library should be opengl32.lib.