How to make your own library?

I know this isn't really something to ask in the BEGGINERS C++ section, but I was looking for a way to make my programming faster, and code easier to remember, and have less lines, and I was thinking if I had my own library to add my own #include things and what not, I'd be able to use THAT to code, instead of regular C++.
To create a static library (which is probably what you want) for the use with GCC, compile your files that are supposed to be part of the library as usual:
g++ -c file1.cpp -o file1.o
g++ -c file2.cpp -o file2.o

etc.
and then create the library using ar:
ar r your_library.a file1.o file2.o ...

An IDE like Code::Blocks will do that for you if you specify "Static library" as the project type.
Now all you need to do is to link your projects against your_library.a
Topic archived. No new replies allowed.