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?
Asked
Active
Viewed 2,957 times
-1
-
Shouldn't it be in lower-cases, like `-lsdl2` or alike? – alk Aug 01 '15 at 21:53
-
I don't think so but possibly thanks for the input. – Simon gardner Aug 01 '15 at 21:55
-
1I downvoted the question because OP does not bother to comment on the answers though he was on multiple times. – Kijewski Aug 07 '15 at 22:28
2 Answers
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