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

Author Topic: Problem with adding texture (_imp___ZN2...)  (Read 3249 times)

0 Members and 2 Guests are viewing this topic.

DarQ

  • Newbie
  • *
  • Posts: 7
    • View Profile
Problem with adding texture (_imp___ZN2...)
« 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 :(

74oshua

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problem with adding texture (_imp___ZN2...)
« Reply #1 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.)

DarQ

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Problem with adding texture (_imp___ZN2...)
« Reply #2 on: June 16, 2017, 11:41:08 pm »
...
Quote
i ve got code blocks 16.01 mingw
...

74oshua

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problem with adding texture (_imp___ZN2...)
« Reply #3 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.

DarQ

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Problem with adding texture (_imp___ZN2...)
« Reply #4 on: June 17, 2017, 01:21:13 pm »
I did it so many times :P And in good order (like in official tutorial) ;/

Ionut

  • Jr. Member
  • **
  • Posts: 59
  • Guess Who's Back ?
    • View Profile
    • Email
Re: Problem with adding texture (_imp___ZN2...)
« Reply #5 on: June 17, 2017, 01:32:32 pm »
Delete that project and make another one ;), be very careful how you link the libraries
Guess Who's Back ?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Problem with adding texture (_imp___ZN2...)
« Reply #6 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DarQ

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Problem with adding texture (_imp___ZN2...)
« Reply #7 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