% c++ -O2 -I/usr/local/include -Wall -c -o test.o test.cpp
% cc -L/usr/local/lib test.o -lPocoFoundation -o test
-Wall enables all compiler's warning messages. This option should always be used, in order to generate better code. In practice, the optimization level -O2 is needed to give good warnings...
Note that there is no need to use the option ‘-o’ to specify the name of the output file in this case. When compiling with ‘-c’ the compiler automatically creates an object file whose name is the same as the source file, with ‘.o’ instead of the original extension.