#include <stdio.h>
#include <stdlib.h>
#include "SFont.h"
#include "SDL.h"
#include "SDL_timer.h"
SFont_Font* Font;
Font = SFont_InitFont(IMG_Load("24P_Copperplate_Blue.png"));
Using SFont with SDL
error C3861: 'IMG_Load': identifier not found, even with argument-dependent lookup
I'm getting the above error when I try to use the SFont library to load fonts.
Anyone got any suggestions?
If I try to add SDL_Image.h to the includes VS.NET complains...
no, is there documentation for setting it up under VS.NET? All I can find are setups for Linux/Unix.
You use it the same way you did with SDL. Actually all you have to do is copy the SDL_Image.lib to where your SDL.lib and SDLmain.lib are, copy the SDL_Image.h file to where your SDL.h file is, and finally copy all the .dlls to either your system32 folder or the current project's directory. When all that is done, all you need to do is #include "SDL_Image.h" and you are all set!
Quote:Original post by murdock
Now I'm getting unresolved externals
Did you link in SDL_Image.lib as you did with SDL.lib and SDLmain.lib?
the SDL_Image.lib is in the same directory as the SDL.lib
SDL_image.h is in the same file as the other SDL_???.h files..
SDL_image.h is in the same file as the other SDL_???.h files..
ok if I go to project->properties then the linker tab and command line
If I add the sdl_image.lib to the additional options everything works
Is there a way to make this change more permanent so I don't have to add this for every new project?
If I add the sdl_image.lib to the additional options everything works
Is there a way to make this change more permanent so I don't have to add this for every new project?
Quote:Original post by murdock
Is there a way to make this change more permanent so I don't have to add this for every new project?
Not really. Setting the project settings is a once per project thing. I mean you could probabally override the default program template or make your own so it is auto-linked, but that might be too much trouble.
Alternatively, you can simply link in Microsoft based compiler with the line:
#pragma comment ( lib, "SDL_Image.lib" )
So what you can do is open up your SDL.h header file and add this to the top:
#pragma comment ( lib, "SDLmain.lib" )
#pragma comment ( lib, "SDL.lib" )
In the SDL_Image.h file:
#pragma comment ( lib, "SDL_Image.lib" )
That way, those libraries are auto linked whenever you use the header files [wink] I've used methods such as those before in frameworks to "make life easier"™ Have fun!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement