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

Author Topic: SFML\Window.hpp gives cstdlib errors  (Read 3173 times)

0 Members and 1 Guest are viewing this topic.

epi

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML\Window.hpp gives cstdlib errors
« on: May 18, 2010, 04:50:47 pm »
Visual Studio 2010
SFML 1.6

Hi guys, I just ran across SFML yesterday and I'm trying to do the simple window tutorial from the site here: http://www.sfml-dev.org/tutorials/1.6/window-window.php  Seems that I'm getting some errors just from including SFML\Window.hpp.  Any help would be appreciated :D.


Code: [Select]

Error 1 error C2039: 'abort' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 10.0\vc\include\cstdlib 21 1 smfl_ogl_testing
Error 3 error C2039: 'exit' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 10.0\vc\include\cstdlib 24 1 smfl_ogl_testing
Error 2 error C2873: 'abort' : symbol cannot be used in a using-declaration c:\program files\microsoft visual studio 10.0\vc\include\cstdlib 21 1 smfl_ogl_testing
Error 4 error C2873: 'exit' : symbol cannot be used in a using-declaration c:\program files\microsoft visual studio 10.0\vc\include\cstdlib 24 1 smfl_ogl_testing
5 IntelliSense: the global scope has no "abort" c:\program files\microsoft visual studio 10.0\vc\include\cstdlib 21 13
6 IntelliSense: the global scope has no "exit" c:\program files\microsoft visual studio 10.0\vc\include\cstdlib 24 13


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML\Window.hpp gives cstdlib errors
« Reply #1 on: May 18, 2010, 04:58:38 pm »
It doesn't seem to be related to SFML.
Laurent Gomila - SFML developer

epi

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML\Window.hpp gives cstdlib errors
« Reply #2 on: May 18, 2010, 05:21:55 pm »
Well, only happens if I #include <SFML\Window.hpp>?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML\Window.hpp gives cstdlib errors
« Reply #3 on: May 18, 2010, 06:15:18 pm »
The errors are located in standard headers, and are about functions that SFML doesn't use.

Moreover, other users have already used VC++10 without errors. It looks like your Visual Studio installation is corrupted.
Laurent Gomila - SFML developer

epi

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML\Window.hpp gives cstdlib errors
« Reply #4 on: May 19, 2010, 02:02:23 am »
Ok Laurent, thanks for your help.  Now, if I can bother you one more time :D.  

Here's my code again:
Code: [Select]

#include <SFML/Window.hpp>

#pragma comment(lib, "sfml-system-s-d.lib")
#pragma comment(lib, "sfml-window-s-d.lib")

int main()
{
   // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");


   bool Running = true;
   while (Running)
   {
      App.Display();
   }

   return EXIT_SUCCESS;

}


Isn't this the correct way to statically link the libraries?  I'm also in debug mode.  This seems to work ok if I don't use the static library.

Linker errors: (not entire list, its pretty long)
Code: [Select]

Error 50 error LNK1120: 12 unresolved externals C:\Users\epidemicz\documents\visual studio 2010\Projects\sfml_ogl_testing\Debug\sfml_ogl_testing.exe sfml_ogl_testing
Error 19 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (__imp_??1_Container_base_secure@std@@QAE@XZ) C:\Users\epidemicz\documents\visual studio 2010\Projects\sfml_ogl_testing\sfml_ogl_testing\sfml-window-s-d.lib(VideoMode.obj) sfml_ogl_testing
Error 25 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) C:\Users\epidemicz\documents\visual studio 2010\Projects\sfml_ogl_testing\sfml_ogl_testing\sfml-window-s-d.lib(WindowImpl.obj) sfml_ogl_testing
Error 27 error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) C:\Users\epidemicz\documents\visual studio 2010\Projects\sfml_ogl_testing\sfml_ogl_testing\sfml-window-s-d.lib(WindowImplWin32.obj) sfml_ogl_testing

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML\Window.hpp gives cstdlib errors
« Reply #5 on: May 19, 2010, 08:44:36 am »
You have to recompile SFML, because the supplied libraries are for Visual C++ 2008.
Laurent Gomila - SFML developer