When I attempt to compile a .c file with cc, I get an error that the -KPIC option is unrecognized. My command line is:
"cc" -g -erroff=%none -KPIC -DBOOST_ALL_NO_LIB=1 -I"../../.." -c -o "arithmetic_c.o" "arithmetic.c"
and the error is:
cc: error: unrecognized command line option â€˜-KPICâ€™
Is this a bug in the C compile ( notice the output of the error ) or is the -KPIC option not used for C compilation ? If the latter is there an equivalent option for -KPIC when doing C compilation ?
Your cc command is probably picking up gcc instead of Solaris Studio cc. Run the command
% which cc
Then see if that is a symbolic link to gcc. Or you could run
% cc -v
and see if it says it is gcc.
If none of these is the case, and you get a "usage" error from "cc -v", try running
% cc -V
and see if it says "Sun C".