SFML community forums
Help => General => Topic started by: Pombal on April 23, 2010, 09:13:24 pm
-
I compiled the packages with vs2010 and got linker errors.
I changed the platform toolset from v100 to v90 and it ran without a problem.
If i change the platform toolset again it compiles but it gives me an acess violation exception in WindowImplWin32.cpp line 140:
int count = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, title.c_str(), static_cast<int>(title.size()), wTitle, sizeof(wTitle) / sizeof(*wTitle));
My question is:
Is this a common problem? How do i use sfml2 or 1.6 with visual studio 2010?
Thanks
-
What linker errors did you get? Did you rebuild completely everything with VC 2010?
-
Not everything, i left the samples. Just rebuilt the sfml-* packages.
I was just using Window.hpp so only got a linker error regarding
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
and App.Display(), IsOpened() and, Close().
If you need the exact message and code i will try to reproduce it.
Thanks.
-
Are you sure that you don't have other versions that may conflict?
If you compile the samples, do you get the same errors?
-
Sorry, I didn't explain myself clearly.
I have no problem compiling, just using what i compiled. I compile everything but the samples and got no errors.
When i try to build the first window tutorial i got an error like the one in this post : http://www.sfml-dev.org/forum/viewtopic.php?t=2478
but instead of errors with string, i got errors with the functions of Window.hpp that i use.
-
It was already clear enough ;)
Stupid question: do you link to sfml-window.lib?
And you should really try to compile the samples, as they are supposed to be configured properly and produce no linker errors.
-
Yes, i did.
I compiled the samples without errors. When i used them they ran flawlessly too. So i copied the code from the sample window to my project and it worked :shock: I deleted the opengl code and libs and the result was what i had previously, the window tutorial. It ran without a problem... AFAIK there was no change.
This was all in debug mode so i tried it with release mode. I got this error:
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z)
I don't think this is equal to the error that brought me here in the first place but i could be wrong.
And now i removed the comments to paste the code, built and it ran without a problem. i didn't change absolutely anything :?
Now it just crashes in release mode, and only if i start without debugging (CTRL + F5). I debug it and it runs perfectly. Only a few times in debug mode i can see it crashes in
sf::Window window(sf::VideoMode(640, 480, 32), "SFML Window");
This is getting too strange... These crashes appear almost randomly.
Any ideas?
-
do they appear to you when u run the exe when not using visual studio to start it?...
-
only if i run the release exe. the debug exe runs as it should.
-
Do you link to the release libraries in release mode (without the "-d" suffix)?
-
yes
-
What about the external dependencies?
-
They are supposed to work without being recompiled; at least the VC2005 binaries work with VC2008.
But yeah, you can try.
-
ok... may You please tell us "exactly" what to check and how to set up visual studio for sfml 1.6, please?... I´d be very thankful, since this may help him and me(the lnk-error thread below this one)...
thanks in advance:)...
-
Nothing more than what the tutorial says. It's the same for every version of SFML and every version of Visual Studio, except that I don't provide precompiled binaries for VC2010 so you have to recompile SFML yourself.
I have no idea what's happening with you :?
-
If I want to run the sample from the documentations first page... what libs do i have to include and which macros to define?...
i get way over 250 errors... 51 unresolved external symbols...
e.g.:Error 311 error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==<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 &,char const *)" (__imp_??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z) C:\Users\Incubbus\Documents\Visual Studio 2010\Projects\Zeros-Test\Zeros-Test\sfml-graphics-s-d.lib(ImageLoader.obj)
-
ok... somehow the compilation and linking succeeds...
but then when the console window does appear there is an system error telling me that the sfml-audio.dll does not exist (and hell it does)...
-
i think im going back to DirectX... it seems way easier to get it running ^^...
-
but then when the console window does appear there is an system error telling me that the sfml-audio.dll does not exist (and hell it does)...
If it says so, it must be right... ;)
Is this DLL in a directory contained in the PATH evironment variable, or in the same directory as the executable?
-
Is this DLL in a directory contained in the PATH evironment variable, or in the same directory as the executable?
It is in an directoy on my desktop and I did make an entry in the VC-Directories property page
On the following screenshot I show the property pages setting, the error(im sorry - its in german, but it says: The program can not be started, because sfml-system-s-d.dll is missing on the system. Please reinstall the application...
(http://www.incubbus.eu/sfml.jpg)[/code]
EDIT: I even did redownload the sfml-package...
EDIT 2: If i copy the dll into the exe-directory and retry running the application, there does occur an application error, that says: The Application could not start correctly (0xc0150002). Click "OK" to close the Application.
[/b]
-
and... any clues?...
-
I had the same problem as it's shown at the first post. To solve it I recompiled the SFML solution in configuration Release DLL witht runtime library set to Multu-threaded DLL. And now - it works!
-
through you pragma comment the -s-d lib, why does he want a dll???
Try to put that specific dll in the project homedirectory. it should be where the *.sln file is.