Undefined reference to `CreateHicolorPixel'


Hello I’m trying to learn sdl1.2 because Iv’e got the book, “programming games in linux” I keep trying to compile this file :



gcc main.c -lSDL -lSDLmain -Wimplicit-function-declaration -o draw

but I keep getting "undefined reference to ‘CreateHicolorPixel’ am I missing a linking handle in my gcc arguments? what am I doing wrong?



It’s a typo in your code: the function in line 5/6 is called “CreateHiColorPixel” but you try to call “CreateHicolorPixel” (with lowercase-‘c’ in “color”) in line 44