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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - accelleon

Pages: [1]
1
General / Buffer overrun
« on: June 25, 2009, 11:30:03 pm »
When running the time handling tutorial (the third window tut) I come across a buffer overrun error. I am using the Multibyte Character Set because in my first test try with my own application the Unicode Char Set caused a buffer overrun but when i switch to Unicode it works fine. I am using the SVN version (1.6). I compiled the dlls, libs, static libs, and debug libs. The thing is this still happened on 1.5 here is the source:

Code: [Select]

#include <SFML\Window.hpp>

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
using namespace std;

sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window Test");
sf::Clock Clock;

App.UseVerticalSync(false);

const float Speed = 50.f;
    float Left = 0.f;
    float Top  = 0.f;

while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();

if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}

float ElapsedTime = Clock.GetElapsedTime();
Clock.Reset();

if (App.GetInput().IsKeyDown(sf::Key::Left))  Left -= Speed * ElapsedTime;
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Left += Speed * ElapsedTime;
        if (App.GetInput().IsKeyDown(sf::Key::Up))    Top  -= Speed * ElapsedTime;
        if (App.GetInput().IsKeyDown(sf::Key::Down))  Top  += Speed * ElapsedTime;

App.Display();
}

return EXIT_SUCCESS;
}


I'm using Visual Studio 2010 Beta 1 (if you want to see how to configure look at my SFML and Visual Studio 2010 Beta 1 (Visual C++ 10 only) topic here).

I don't know if this only happens with VS 2010 or if it happens with VS 2008 also I have both but i didn't use VS 2008 because in my opinion VS 2010 is better but back on topic.

I should also mention that I'm using dynamic linking because the static libs aren't linking right (look at this post to help.[/url]

2
General / Error with static linking
« on: June 25, 2009, 03:36:40 pm »
when i try to static link sfml-system-s.lib and sfml-window-s.lib it runs this error:
1>sfml-window-s.lib(WindowImplWin32.obj) : 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)
1>sfml-window-s.lib(Window.obj) : 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)
1>sfml-window-s.lib(VideoMode.obj) : 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)
1>sfml-window-s.lib(WindowImpl.obj) : 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)
1>sfml-window-s.lib(VideoModeSupport.obj) : 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)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z)
1>sfml-window-s.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z)
1>C:\Users\Tony\Documents\Visual Studio 10\Projects\SFML_Window_Tut\Release\SFML_Window_Tut.exe : fatal error LNK1120: 2 unresolved externals

Please help as i don't know what the problem is because it works when i dynamic link them and no SFML_DYNAMIC is not defined.

3
General / SFML and Visual Studio 2010 Beta 1 (Visual C++ 10 only)
« on: June 25, 2009, 02:30:04 pm »
This is quite different than Visual Studio 2008 but still similar.
Ok lets start assuming you already have Visual Studio 2010 Beta 1 and SFML any version.

Open Visual Studio 2010.
Create a Console Project (any name, you'll delete it later).
Open Property Manager.
Expand the only node there.
Expand the Release | Win32 node.
Double click Microsoft.Cpp.Win32.user
Expand Configuration Properties.
Click on VC++ Directories.
In the Include row add a colon then the includes path of SFML
In the Libraries row add a colon then the lib path of SFML

NOTE:
Only add the colon if the Include or Libraries row is not blank.

If you delete the contents of Include or Libraries row click cancel then double click Microsoft.Cpp.Win32.user

When done click Apply then Ok.
Go to your Visual Studio 2010 Projects Directory and delete the project you just made.

This only has to be done once.

I really hope this helps anyone who uses Visual Studio 2010 but didn't know how.

Pages: [1]
anything