Fuck, I can't believe this. I tried to get SFML working in VC++ Express 2010. Nothing, I get a shitload of errors on compile.
Then I said, maybe it's just VC++.. fucking not. I tried with Code::Blocks. I followed the guide, I run the program and I get the "sfml-system-d.dll not found" error. Well, I said, maybe I have to copy it in the folder where the .exe is (even though I don't think this is ther right method, what should I do?).
So yeah now it runs, but it's just a basic program.
I go to the SFML website, I download the same [url=http://www.sfml-dev.org/tutorials/1.6/window-window.php]sample[/url] I used in VC++, that should create a window. Try and compile it and:
[media]http://dl.dropbox.com/u/2951174/codeblocks.png[/media]
Same error I got with VC++. And I have no idea what the fuck it means. I only know that it's something related to windows since it doesn't fuck with the other ones.
What the fuck it is? Help. I never got any C++ library to work (I tried SDL, Wx, and both gave these kind of errors)
What the hell am I doing wrong?
Copying the DLL to the directory is the correct procedure. Although you don't want to ship with the debug DLL.
Those errors result from not linking any libraries. (DLLs are the libraries that contain the functions but it's a bit more complicated of Windows) I can't recall which SFML lib the window functions were in, though.
[QUOTE=esalaka;26428630]Copying the DLL to the directory is the correct procedure. Although you don't want to ship with the debug DLL.
Those errors result from not linking any libraries. (DLLs are the libraries that contain the functions but it's a bit more complicated of Windows) I can't recall which SFML lib the window functions were in, though.[/QUOTE]
Thanks, I hadn't added the -lsfml_window in the linker options. Fucking guides, why do they take everything for granted.
[editline]1st December 2010[/editline]
I'm trying to fix this in Visual Studio too. But I dont know what to do. It only works with things that use SFML/System.hpp, but wont work with window. What should I do?
Those nonsensical-looking names in the error messages are actually the "mangled" names of C++ functions, that incorporate scope and type information. The GCC compiler has an associated tool called "c++filt" that translates them back into readable form, and Visual C++ has a similar tool called "undname" that does the same thing (though I haven't used it).
For example, running c++filt on "_ZN2sf9VideoModeC1Ejjj" gives me "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)". (The "_imp_" prefix isn't part of the C++ name.)
Oh I see. Why the hell didn't they do that by default?
The linker (which is what's giving you those errors) is language-agnostic and doesn't know or care about C++-isms like name mangling. It just cares about matching up symbol names in one object file with identical symbol names in another object file or library.
C++ name mangling is a way to make the language's flexible naming rules compatible with the simpler mechanics used by linkers. In a C++ program you can have multiple functions with the same name, due to overloading (e.g. foo(int) vs. foo(char)) or differing scopes (e.g. MyClass::foo() vs. YourClass::foo()). You don't want a call to the foo(int) function to translate into a jump to the compiled code of the foo(char) function, so the two functions need to have different names in the object file so that the linker can tell them apart.
What looks like nonsense is actually a carefully-designed encoding scheme that packs all the C++ type information into a concise string (keeping it short speeds up string comparisons) that fits within the limited set of characters allowed in symbol names.
Sorry, you need to Log In to post a reply to this thread.