return 0; }libss.c #include <stdio.h> #include <string.h>void print() { printf("I am print
"); }int add(int a, int b) { printf("Sum %d and %d is %d
", a, b, a + b); return 0; } //static void king() __attribute__((constructor(101))); the following is also right static __attribute__((constructor(101))) void king() { printf("I am king
"); }编译执行: gcc -Wall -shared -fPIC -o libss.so libss.c -ldl gcc -Wall -o udlopen udlopen.c