SFML community forums
Help => Graphics => Topic started by: lorence30 on May 24, 2015, 07:06:13 pm
-
undefined reference to `_imp___ZN2sf5ImageD1Ev'|
why i keep getting this error? i cant start my program.
im using C::B 13.12, SFML 2.1
but i can use the other classes in graphics like texture and sprites fine.
-
Because you linked something wrong.
-
sfml-graphics
sfml-window
sfml-system
this is what im linking
and SFML_STATIC for static linking.
i dont know what to do now, i have read many threads but didnt help
-
Have you added the -s to all sfml libraries and -d if they're in debug mode? Also, have you linked all of sfml's dependencies?
-
@shadowmouse
i tried all, like i said i can use sf::Texture and sf::Sprite fine.
but it spit out that error because of the sf::Image
-
The sf::Image destructor was added after SFML 2.1.
So you are most likely including a header file from a newer sfml version while still linking to the older libraries.
-
[qoute]The sf::Image destructor was added after SFML 2.1.
So you are most likely including a header file from a newer sfml version while still linking to the older libraries.[/qoute]
Im using 2.2's header file and linking with 2.1
i cant get 2.2's dll to work :(
-
Why not just use 2.3 rather than trying to mix and match libraries and headers from different versions which is bound to go wrong?
-
is this the best release? http://www.sfml-dev.org/download/sfml/2.3/ or nightly?
-
Just get MinGW 4.9.2 (it's the best version) and use the one from the link you provided.
-
is mingw okay? TDM (SJLJ) - 32-bit is what im using in 2.1
-
TDM is notorious, which is why I said use the latest version of MinGW, which is 4.9.2.
-
okay Ill tell you when its done
(i use TDM because it says on the tutorial)
-
sfml-graphics
sfml-window
sfml-system
this is what im linking
and SFML_STATIC for static linking.
i dont know what to do now, i have read many threads but didnt help
The tutorial also says that when static linking you need to link to -s version of the library (sfml-graphics-s etc.) and to several other dependencies. (freetype, etc.) if you're using SFML > 2.1
Don't try to mix 2.1 and 2.2, that's crazy.
Download and use the version compatible with your compiler. If you say that you previously used "GCC 4.7 TDM (SJLJ) - 32-bit" with 2.1, I'd try "GCC 4.7.1 TDM (SJLJ) - 32-bit" for 2.3. (Or better, check what your compiler is and use the same version or compile SFML yourself. :p )
-
I cant get mingW 4.9.2 to work
i keep getting this error
http://puu.sh/hZNZe/f7a23a5f0e.png
-
It's very hard, but you have to use the version of SFML compiled for the compiler you use...
From what I can read on the CB download page (http://www.codeblocks.org/downloads/26) , if you use the compiler package with codeblocks it's either the TDM 4.7.1 or TDM 4.8.1...
Is there a reason why you're trying to use 4.9.2?
-
That's because I recommended it because binary recommended it for me as the best version as it is more stable and reliable than 4.8.1 and has c++11 which is good as 4.7.1 doesn't.
-
But it has to match your compiler version. :p
-
Yes, so you download the 4.9.2 version of sfml 2.3 and the compilerless version of codeblocks.