EDIT: Apparantly ~ doesn't work here and only in the shell, replace ~ with '$HOME' and it should work, thanks for everybody who answered.
Trying to compile a project here but it seems it can't find the libraries even though they exist, here is the output of my line and proof that the libraries exist.
pi@raspberrypi ~/Car $ g++ Car.cpp -I~/git/robidouille/raspicam_cv -L~/git/robidouille/raspicam_cv -lraspicamcv -L~/git/userland/build/lib -lmmal_core -lmmal -lmmal_util -lvcos -lbcm_host -I/usr/include/opencv -lopencv_highgui -lopencv_core -lopencv_video -lopencv_imgproc -lpthread -lm
/usr/bin/ld: cannot find -lraspicamcv
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lvcos
/usr/bin/ld: cannot find -lbcm_host
collect2: ld returned 1 exit status
pi@raspberrypi ~/Car $ find ~/ -name libraspicamcv.so
pi@raspberrypi ~/Car $ find ~/ -name libmmal_core.so
pi@raspberrypi ~/Car $ find ~/ -name libmmal.so
pi@raspberrypi ~/Car $
ld -L~/git/userland/build/lib -lmmal_core --verbose
attempt to open ~/git/userland/build/lib/libmmal_core.so failed
Expanding "~" to your home directory is a feature of the shell, and it is not expanded "inside" a parameter such as
When the linker goes looking for the library, it doesn't ask your shell where it is — it tries to find the literal path "~/git/robidouille/raspicam_cv", which doesn't exist.
Replace "~" with "$HOME", which will be expanded by the shell.