c++ - SDL_Quit is ambigious -
everytime use sdl_quit or sdl_mousebuttondown or event error messages ambigious.i using sdl 2.0 , error dissapears when don't include sdl_image.h. don't know or whats problem? ideas?
void game::handleevents() { sdl_event event; if(sdl_pollevent(&event)) { switch (event.type) { case sdl_mousebuttondown: m_brunning = false; break; default: break; } } }
my sdl_image.h
/* sdl_image: example image loading library use sdl copyright (c) 1997-2013 sam lantinga <slouken@libsdl.org> software provided 'as-is', without express or implied warranty. in no event authors held liable damages arising use of software. permission granted use software purpose, including commercial applications, , alter , redistribute freely, subject following restrictions: 1. origin of software must not misrepresented; must not claim wrote original software. if use software in product, acknowledgment in product documentation appreciated not required. 2. altered source versions must plainly marked such, , must not misrepresented being original software. 3. notice may not removed or altered source distribution. */ /* simple library load images of various formats sdl surfaces */ #ifndef _sdl_image_h #define _sdl_image_h #include "sdl.h" #include "sdl_version.h" #include "begin_code.h" /* set c function definitions, when using c++ */ #ifdef __cplusplus extern "c" { #endif /* printable format: "%d.%d.%d", major, minor, patchlevel */ #define sdl_image_major_version 2 #define sdl_image_minor_version 0 #define sdl_image_patchlevel 0 /* macro can used fill version structure compile-time * version of sdl_image library. */ #define sdl_image_version(x) \ { \ (x)->major = sdl_image_major_version; \ (x)->minor = sdl_image_minor_version; \ (x)->patch = sdl_image_patchlevel; \ } /* function gets version of dynamically linked sdl_image library. should not used fill version structure, instead should use sdl_image_version() macro. */ extern declspec const sdl_version * sdlcall img_linked_version(void); typedef enum { img_init_jpg = 0x00000001, img_init_png = 0x00000002, img_init_tif = 0x00000004, img_init_webp = 0x00000008 } img_initflags; /* loads dynamic libraries , prepares them use. flags should 1 or more flags img_initflags or'd together. returns flags initialized, or 0 on failure. */ extern declspec int sdlcall img_init(int flags); /* unloads libraries loaded img_init */ extern declspec void sdlcall img_quit(void); /* load image sdl data source. 'type' may 1 of: "bmp", "gif", "png", etc. if image format supports transparent pixel, sdl set colorkey surface. can enable rle acceleration on surface afterwards calling: sdl_setcolorkey(image, sdl_rleaccel, image->format->colorkey); */ extern declspec sdl_surface * sdlcall img_loadtyped_rw(sdl_rwops *src, int freesrc, const char *type); /* convenience functions */ extern declspec sdl_surface * sdlcall img_load(const char *file); extern declspec sdl_surface * sdlcall img_load_rw(sdl_rwops *src, int freesrc); #if sdl_version_atleast(2,0,0) /* load image directly render texture. */ extern declspec sdl_texture * sdlcall img_loadtexture(sdl_renderer *renderer, const char *file); extern declspec sdl_texture * sdlcall img_loadtexture_rw(sdl_renderer *renderer, sdl_rwops *src, int freesrc); extern declspec sdl_texture * sdlcall img_loadtexturetyped_rw(sdl_renderer *renderer, sdl_rwops *src, int freesrc, const char *type); #endif /* sdl 2.0 */ /* functions detect file type, given seekable source */ extern declspec int sdlcall img_isico(sdl_rwops *src); extern declspec int sdlcall img_iscur(sdl_rwops *src); extern declspec int sdlcall img_isbmp(sdl_rwops *src); extern declspec int sdlcall img_isgif(sdl_rwops *src); extern declspec int sdlcall img_isjpg(sdl_rwops *src); extern declspec int sdlcall img_islbm(sdl_rwops *src); extern declspec int sdlcall img_ispcx(sdl_rwops *src); extern declspec int sdlcall img_ispng(sdl_rwops *src); extern declspec int sdlcall img_ispnm(sdl_rwops *src); extern declspec int sdlcall img_istif(sdl_rwops *src); extern declspec int sdlcall img_isxcf(sdl_rwops *src); extern declspec int sdlcall img_isxpm(sdl_rwops *src); extern declspec int sdlcall img_isxv(sdl_rwops *src); extern declspec int sdlcall img_iswebp(sdl_rwops *src); /* individual loading functions */ extern declspec sdl_surface * sdlcall img_loadico_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadcur_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadbmp_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadgif_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadjpg_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadlbm_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadpcx_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadpng_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadpnm_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadtga_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadtif_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadxcf_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadxpm_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadxv_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_loadwebp_rw(sdl_rwops *src); extern declspec sdl_surface * sdlcall img_readxpmfromarray(char **xpm); /* individual saving functions */ extern declspec int sdlcall img_savepng(sdl_surface *surface, const char *file); extern declspec int sdlcall img_savepng_rw(sdl_surface *surface, sdl_rwops *dst, int freedst); /* we'll use sdl reporting errors */ #define img_seterror sdl_seterror #define img_geterror sdl_geterror /* ends c function definitions when using c++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _sdl_image_h */
the error description resource path location type 'sdl_quit' ambiguous ' candidates are: 'line 70 semantic error
Comments
Post a Comment