c++ eclipse odd compiler error messages -
i getting extremely weird errors in code. on line function declared, says string not part of std, , 'variable ‘sdl_texture loadimage’ has initializer incomplete type'. on line after that, says expected ; before curly brace. same snippet of code literally working minute ago. can fix it? if need more information, gladly give it. also, running on linux, might make difference, too.
#include <sdl2/sdl.h> #include <sdl2/sdl_image.h> #include "levelrenderer.h" #include "err_log.h" sdl_texture loadimage(std::string path) { return loadtexture(getresourcepath() + path + ".png", getlevelscreen()); }
it means haven't included header defines sdl_texture
; 1 declares it. makes incomplete , can limited things it. in particular, can't create instance of it, function when returns value.
according google skills, need include <sdl_sysrender.h>
.
you should include <string>
since you're using std::string
. may cause of second error; if 1 of other headers happens include you, it's better not rely on that.
Comments
Post a Comment