1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
gcc -E hello.c -o hello.i
gcc -S hello.i
gcc -c hello.s
gcc hello.o -o hello
gcc -I./what -c hello.c
gcc -L./what -c hello.c
ar rcs libmyh.a myh.o
gcc hello.o ./what/libmyh.a -o hello
gcc -I./what -L./what hello.c -o hello -lmyh
gcc -shared -fPIC *.c -o libwhat.so
gcc -I./what -L./what hello.c -o hello3 -lwhat
./hello3
有三种办法解决:
ldd dynamic hello3
nm libwhat.a nm libwhat.so
|