Thursday, January 12, 2017

MAC gcc g++ error while creating libraries clang: error: unknown argument: '-soname

The error is generated by the following command:

gcc -shared -WI -soname,libaverage.so.1 -o libaverage.so.1.0.1 average.o

It is solved by replacing -soname with install_name, i.e.,
gcc -shared -WI -install_name,libaverage.so.1 -o libaverage.so.1.0.1 average.o