Followers 0

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

## 5 posts in this topic

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

0

Seriously..

-1

##### Share on other sites

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.

0

##### Share on other sites

i have installed the SDL_gfx library

and put it in the linker -ISDL_gfx

0

##### 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.

0

##### 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.

0

## Create an account

Register a new account