Jump to content

  • Log In with Google      Sign In   
  • Create Account

Using SDL Rotozoom


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 too_many_stars   Members   -  Reputation: 213

Like
0Likes
Like

Posted 24 December 2013 - 09:12 AM

Hi guys,

 

I am having a problem using SDL_Rotozoom.

 

(1) I downloaded the SDL2_gfx library.

(2) I put the SDL2_rotozoom.h and SDL2_rotozoom.c into my project folder

(3) Then, I typed in <SDL_rotoroom.h> (I am not sure why the file is called SDL2_rotozoom.h, beacuse when I type in <SDL2_rotozoom.h> visual studio complains.

(4) I went into project->c/c++->general->additional include directories and put in my path for my project

 

However, when I try to compile, visual studio tells me:

 

"1>main.obj : error LNK2019: unresolved external symbol _rotozoomSurface referenced in function _SDL_main
1>C:\Users\Mike\Documents\Visual Studio 2010\Projects\sdl_tutorial\Debug\sdl_tutorial.exe : fatal error LNK1120: 1 unresolved externals"

 

I have never tried to use an "outside" .h and .c in any of my projects before so I am not quite sure what I am doing wrong. Any help would be greatly appreciated.

 

Thanks,

 

Mike



Sponsor:

#2 Karsten_   Members   -  Reputation: 1655

Like
0Likes
Like

Posted 24 December 2013 - 09:48 AM

With SDL 1.x you need to link in SDL_gfx

// GNU C/C++
gcc ... -lSDL_gfx ...
 
// Visual C/C++
cl ... /link SDL_gfx.lib

Since SDL 2.x is still too trendy for me (and less portable than 1.x), I still have yet to work with it but I can only assume you will need to link in SDL2_gfx.lib?

 

Edit: Just reread that you are using Visual Studio. In that case, try using the IDE project settings to add an additional linker library dependence to SDL2_gfx.lib in the same way that you did with SDL2.lib and SDL2_main.lib


Edited by Karsten_, 24 December 2013 - 09:52 AM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#3 exOfde   Members   -  Reputation: 810

Like
0Likes
Like

Posted 24 December 2013 - 11:41 AM

I would suggest you to put the header you added into the same director like the sdl2 director and to delete the c file. You don't need it if you use a lib.

#4 too_many_stars   Members   -  Reputation: 213

Like
0Likes
Like

Posted 24 December 2013 - 08:01 PM

Thanks for the help guys, I got it working!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS