Sign in to follow this  
Mybowlcut

SFML & Visual Studio 2005

Recommended Posts

I've set up SFML with VS2005 successfully before, but have now come back to it and can't get it to work.

I'm using the sample on the tutorial page:
[source]#include <SFML/System.hpp>
#include <iostream>

int main()
{
sf::Clock Clock;
while (Clock.GetElapsedTime() < 5.f)
{
std::cout << Clock.GetElapsedTime() << std::endl;
sf::Sleep(0.5f);
}

return 0;
}[/source]

My additional include directories under C++ -> General:
[code]"$(DEV_DIR)\SFML-1.6\include"[/code]

Additional library directories:
[code]"$(DEV_DIR)\SFML-1.6\lib"[/code]

In my linker dependencies:
[code]sfml-system-s-d.lib[/code]

When I run from within VS, the SFML Window isn't even created. Instead, the console comes up with the message:
[code]"The system cannot execute the specified program."[/code]

All C++ settings:
[code]/Od /I "E:\Dev\SFML-1.6\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt[/code]

All linker settings:
[code]/OUT:"E:\Dev\Projects\SFML Test2\Debug\SFML Test2.exe" /INCREMENTAL /NOLOGO /LIBPATH:"E:\Dev\SFML-1.6\lib" /MANIFEST /MANIFESTFILE:"Debug\SFML Test2.exe.intermediate.manifest" /DEBUG /PDB:"e:\Dev\Projects\SFML Test2\debug\SFML Test2.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT sfml-system-s-d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib[/code]

I'm using a fresh, out of the box SFML-1.6 package. I haven't rebuilt the projects in the build directory, and from what I can see I'm using all the right project settings.


Cheers.

Share this post


Link to post
Share on other sites
I'll be honest I'm really not too sure, but I figured I would at least mention this in case it helps... try running VS as an administrator (right click it and select run as administrator). Hopefully it helps, but it's really just a shot in the dark so... don't get too hopeful. :-/

Share this post


Link to post
Share on other sites
[quote name='Impervious' timestamp='1306312419' post='4815493']
I'll be honest I'm really not too sure, but I figured I would at least mention this in case it helps... try running VS as an administrator (right click it and select run as administrator). Hopefully it helps, but it's really just a shot in the dark so... don't get too hopeful. :-/
[/quote]
Hey Impervious. I'm on XP and the only options are to run as the current account I'm using - there's no administrator option. My profile is an administrator anyway so it shouldn't matter. Thanks though. :)

Share this post


Link to post
Share on other sites
I downloaded the 2008 package of SFML 1.6 and it worked fine.

C++ settings:
[code]/Od /I "E:\Dev\SFML-1.6\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt[/code]

Linker settings:
[code]/OUT:"E:\Dev\Projects\SFML Test4\Debug\SFML Test4.exe" /INCREMENTAL /NOLOGO /LIBPATH:"E:\Dev\SFML-1.6\lib" /MANIFEST /MANIFESTFILE:"Debug\SFML Test4.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"e:\Dev\Projects\SFML Test4\Debug\SFML Test4.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT sfml-system-s-d.lib sfml-window-s-d.lib sfml-graphics-s-d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib[/code]

I just downloaded the 2005 package of SFML 1.6 again to be sure, but it still won't work. What the hell?

Edit: Just pointed my VS2005 project to use the SFML package for VS2008 and it works fine... that's retarded. Edit: Until I included anything but System... when I tried an example with Windows it gives me:
[code]1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ) referenced in function "public: void __thiscall std::deque<class sf::Event,class std::allocator<class sf::Event> >::push_back(class sf::Event const &)" (?push_back@?$deque@VEvent@sf@@V?$allocator@VEvent@sf@@@std@@@std@@QAEXABVEvent@sf@@@Z)
1>sfml-window-s-d.lib(VideoMode.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>sfml-window-s-d.lib(VideoModeSupport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (__imp_??1_Container_base_secure@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Container_base_aux_alloc_empty<class std::allocator<class sf::Event> >::~_Container_base_aux_alloc_empty<class std::allocator<class sf::Event> >(void)" (??1?$_Container_base_aux_alloc_empty@V?$allocator@VEvent@sf@@@std@@@std@@IAE@XZ)
1>sfml-window-s-d.lib(VideoMode.obj) : 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)
1>sfml-window-s-d.lib(WindowImpl.obj) : 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)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Container_base_aux_alloc_empty<class std::allocator<class sf::Event> >::_Container_base_aux_alloc_empty<class std::allocator<class sf::Event> >(class std::allocator<class sf::Event>)" (??0?$_Container_base_aux_alloc_empty@V?$allocator@VEvent@sf@@@std@@@std@@IAE@V?$allocator@VEvent@sf@@@1@@Z)
1>sfml-window-s-d.lib(VideoMode.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ)
1>sfml-window-s-d.lib(WindowImpl.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ)
1>E:\Dev\Projects\SFML Test2\Debug\SFML Test2.exe : fatal error LNK1120: 3 unresolved externals[/code]

Share this post


Link to post
Share on other sites
[font=Verdana, Arial, Helvetica, sans-serif]I built the VS 2005 SFML 1.6 solution in both debug static and release static and it works fine now. Why won't it work using the precompiled libs?[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this