I\'m currently learning OpenCL. Now, when I want to compile my program, I get an error with this command:
g++ -Wall -l OpenCL main.cpp -o main
With g++ (and generally under Unix), -l
specifies a source of
input (either a .a
or a .so
), and input is processed in
order. When the input is a static library (a .a
file), it
will be scanned for objects which resolve undefined references;
if it is a .so
, there aren't any object files in it, but it
will still only be taken into consideration if it resolves some
undefined symbol.
When you put the -l
before any object files, there are no
undefined symbols yet, so nothing will be incorporated into the
program.