Undefined reference to `CreateHicolorPixel'


#1

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 :

https://pastebin.com/khGks29e

with:

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?

Thanks


#2

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