SFML community forums

Help => Graphics => Topic started by: DarQ on June 16, 2017, 02:26:28 pm

Title: Problem with adding texture (_imp___ZN2...)
Post by: DarQ on June 16, 2017, 02:26:28 pm
Hey , im very desperated noob who has 2 days to make his project. I need to put graphic into it but can't compile it coz of error when i type
if (!texture.loadFromFile("aha.png"));
. It's only 1 error which says
Quote
||=== Build: Debug in ehhhagain (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Users\Dq\Desktop\Milionery\ehhhagain\main.cpp|19|undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
. I have no time and i really need help, yesterday i was googling for 7 hours to find a solution and i found nothing.... I have every lib linked and in good order, i tried to compile sfml by myself but error was the same. i ve got code blocks 16.01 mingw version and GCC 4.9.2 TDM (SJLJ) 32-byte SFML 2.4.2. I don't know what to do, please help me :(
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: 74oshua on June 16, 2017, 08:39:42 pm
Hello! Sorry that you're having problems. Can I ask what program you're using (Code::Blocks, Visual Studio, etc.)
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: DarQ on June 16, 2017, 11:41:08 pm
...
Quote
i ve got code blocks 16.01 mingw
...
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: 74oshua on June 17, 2017, 06:34:50 am
Oh, lol, duh XD sorry. Make sure that you include the release libraries in release mode, and the debug libraries (the ones that end in -d) in debug mode.
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: DarQ on June 17, 2017, 01:21:13 pm
I did it so many times :P And in good order (like in official tutorial) ;/
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: Ionut on June 17, 2017, 01:32:32 pm
Delete that project and make another one ;), be very careful how you link the libraries
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: eXpl0it3r on June 17, 2017, 01:34:24 pm
If you're really using the compiler that comes with C::B and use the mentioned SFML package, it should work fine.

The easiest solution would probably be to just rebuild SFML with your compiler, so everything aligns properly.
Title: Re: Problem with adding texture (_imp___ZN2...)
Post by: DarQ on June 17, 2017, 03:44:59 pm
The problem is that i tried to compile it by myself ;/ I don't know what should i do, i tried everything :P