user3045006
user3045006

Reputation:

SDL_gfx undefined reference

I downloaded the SDL_gfx and did all the stuff (./configure, make install, ...), and even the make checks, but when I'm trying to use the actual function in a source code, it says :

undefined reference to pixelColor.

I included <SDL/SDL_gfxPrimitives.h>, and inside the .h file, there is

int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32)

Do I have to use a special compilation flag for the SDL_gfx?

For now I use -lSDL -lSDL_ttf

Upvotes: 1

Views: 925

Answers (1)

genpfault
genpfault

Reputation: 52083

For now I use -lSDL -lSDL_ttf

Link against SDL_gfx too: -lSDL_gfx

You should probably use pkg-config though:

`pkg-config sdl SDL_ttf SDL_gfx --libs`

That'll spit out everything you need, library-wise:

-lSDL_ttf -lSDL_gfx -lSDL

Upvotes: 1

Related Questions