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

Author Topic: [SOLVED]Strange error with graphics-window.cpp  (Read 3118 times)

0 Members and 1 Guest are viewing this topic.

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
[SOLVED]Strange error with graphics-window.cpp
« on: November 09, 2011, 07:44:04 pm »
Hello,
I've been reading through the SFML tutorials, and I was on the Sprites section.  I downloaded the graphics-window.cpp file, and tried to run it, and I got this weird error:
Quote
-------------- Build: Debug in SFML Sprite Test ---------------

Linking console executable: bin\Debug\SFML Sprite Test.exe
Info: resolving vtable for sf::Spriteby linking to __imp___ZTVN2sf6SpriteE (auto-import)
obj\Debug\graphics-sprite.o: In function `ZNSt8_Rb_treeIPN2sf11ResourcePtrINS0_5ImageEEES4_St9_IdentityIS4_ESt4lessIS4_ESaIS4_EE11_M_put_nodeEPSt13_Rb_tree_nodeIS4_E':
C:/Program Files (x86)/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/stl_construct.h:(.text$_ZN2sf6SpriteD1Ev[sf::Sprite::~Sprite()]+0x3a): variable 'vtable for sf::Sprite' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status


What did I do wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED]Strange error with graphics-window.cpp
« Reply #1 on: November 09, 2011, 08:14:16 pm »
You forgot to define SFML_DYNAMIC.
Laurent Gomila - SFML developer

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
[SOLVED]Strange error with graphics-window.cpp
« Reply #2 on: November 09, 2011, 08:50:07 pm »
I get the same error, even when I added SFML_DYNAMIC to #defines (as explained by the Code::Blocks installation tutorial).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED]Strange error with graphics-window.cpp
« Reply #3 on: November 09, 2011, 10:47:45 pm »
So you probably did it wrong ;)
Laurent Gomila - SFML developer

julen26

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • http://julen26.blogspot.com
[SOLVED]Strange error with graphics-window.cpp
« Reply #4 on: November 10, 2011, 12:35:02 am »
Try to clean the project and build it all again

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
[SOLVED]Strange error with graphics-window.cpp
« Reply #5 on: November 10, 2011, 04:31:23 am »
Thank you, but now the program opens and immediately closes, and in the console window it says it cannot open the file.  I changed "sprite.tga" to a .png file I put in the same folder as the project, files, etc.  Here's the exact error from the console window:
"Failed to load image "myimage.png". Reason : Unable to open file"

julen26

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • http://julen26.blogspot.com
[SOLVED]Strange error with graphics-window.cpp
« Reply #6 on: November 10, 2011, 06:19:54 pm »
Check the project properties and look at the "working dir" field. You can change it, and all resources should be in that folder.

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
[SOLVED]Strange error with graphics-window.cpp
« Reply #7 on: November 11, 2011, 12:29:25 am »
Thank you! It works perfectly now  :D