Jump to content
  • Advertisement
Sign in to follow this  
dwarf99

[Linker error] main.o:main.cpp:(.text+0x2f2): undefined reference to `_imp__rotozoomSurface'

This topic is 1954 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When i try to compile my code in Dev C++ it gives me this error:

   

[Linker error] main.o:main.cpp:(.text+0x2f2): undefined reference to `_imp__rotozoomSurface' 

 

i am very  new to sdl. I am trying to develop a game.

 

Iwant to rotate a image with the rotozoomSurface function but it gives me the error.

 

playerrot=rotozoomSurface(player,angle,1.0,0.0);

player - is the image i want to rotate.

angle is the angle

playerrot is the rotated image

 

Please help!

Share this post


Link to post
Share on other sites
Advertisement

Undefined reference means that the symbol name (although mangled slightly in the output), cannot be found. The linker cannot find the definition of the function rotozoomSurface in this case. Probably because you haven't linked its source or library file.

Share this post


Link to post
Share on other sites

Brother Bob is correct.

 

Also, if you want help, here's some tips:

 

  • Use correct grammar. Lots of us won't even respond when you don't capitalize words, use punctuation, and the like.
  • Give us some information. It's hard to decipher an error when we can't see the code causing it.

With that said, it looks like a problem with you linking the SFML libraries. Try this out.

Share this post


Link to post
Share on other sites

dwarf, some advise;  if you are using SDL and using the sdl gfs library, then you are performing those rotaions in software, and your game will be slow.

 

Please take a look at SFML.  It will make it better in the long run.

 

Does dev-c++ know where to find the sdl gfx library?  Just adding -lSDL_gfx won't help if the compiler can't find the library.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!