Creating a library out of a source file.

Hello I would like to know, how can i create a library (as i am noob static library would be more than enough for me ) out of source files. I obtained 3 source files and 3 corresponding headers:
1
2
3
4
5
6
7
lpc313x_pwm_driver.c
lpc313x_timer_driver.c
lpc313x_adc10b_driver.c

lpc313x_pwm_driver.h
lpc313x_timer_driver.h
lpc313x_adc10b_driver.h 

This is new for me so take it easy on me. I would like to know if there are any differences in creating a c++ library and c library and how to build any of these on Linux (i am Ubuntu user).
Did this page I posted help you? When I wanted to know how to do exactly what you are asking, this is where I got my information.
It didnt work out for me... i should tell before i am making this library for ARM926ej-s processor....

Make some object files:

gcc -march=armv5 -c lpc313x_pwm_driver.c lpc313x_timer_driver.c lpc313x_adc10b_driver.c

Archive them into a library

ar rc newlibrary.a lpc313x_pwm_driver.o lpc313x_timer_driver.o pc313x_adc10b_driver.o
Last edited on
Topic archived. No new replies allowed.