I can't seem to get this working. I have a c++ script that i haven't written myself, that i need to compile with g++. The start of the script looks like this:
#include "x.hh"
#include "y.hh"
#include <iostream>
...
I understand that when using include with quotation marks, that means there are external libraries that have to be included when doing the compiling. The header files, x.hh and y.hh, as well as the files x.cc and y.cc (wich i guess are the libraries) plus the main script are all in the same folder. I've tried to compile them with:
g++ Documents/Cpp/script.cc -o script -L Documents/Cpp -lx -ly
This returns the error:
/usr/bin/ld cannot find -lx
/usr/bin/ld cannot find -ly
collect2 returned 1 exit status
The search path isn't the same as i specified. Even if I write:
g++ Documents/Cpp/script.cc -o script -L sdfsdf/sdfsd-lx -ly
It still looks in /usr/bin/ld
folder. No matter what i write in -L
, I cant get it to work. How?
x.cc
) and header files (x.hh
) with shared library objects (x.so
). Source files are compiled, header files are included, and shared libraries are linked.