-1

After having downloaded the development library for SDL2 and attempting to link it with the -lSDL2 command in gcc, I am told that the library can not be found. Is there a specific directory i should place the framework in ? Or can I specify the directory in the command line so it knows where to link it from?

alk
  • 69,737
  • 10
  • 105
  • 255
Simon gardner
  • 11
  • 1
  • 1

2 Answers2

1

You use the -l (lower-case L) to tell the linker to link with a specific library.

You use the -L option to tell the linker about which folders to search for libraries.

So if you have install SDL2 in a non-standard location, use the -L option to specify where the library is installed, just like you use the -I (capital i) to specify where headers are for the preprocessor to find them.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
0

If you have not placed it within one of the standard paths where to search for libraries, you should set and export a correctly defined LD_LIBRARY_PATH/LIBRARY_PATH variable.

This discussion contains enough information.

Community
  • 1
  • 1
skypjack
  • 49,335
  • 19
  • 95
  • 187