Using the arm-linux-ar and the arm-linux-ranlib

Static library is needed at compile time libraries.

1. Create a static library

[arm@localhost gcc]#arm­linux­ar ­r libhello.a h1.o h2.o

 

2. indexing static library

[arm@localhost gcc]#arm­linux­ar ­s libhello.a [arm@localhost gcc]#arm­linux­ranlib libhello.a

 

3. produce an executable file from a static library

[Arm @ localhost gcc] #armlinuxgcc o hello hello.c lhello L. / [arm @ localhost gcc] #armlinuxgcc o hello hello.c libhello.a hello files can be copied directly to / tmp directory run without libhello.a .

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11105592.html