To answer a specific question, how to convert several source files into one archive file for static linking; This is a two-step operation. You must first compile the source files into object files, and then turn the object files into an archive.
If you have MSYS with MinGW installed, I recommend using this. If not, you can still use the cmd.exe Windows command prompt.
Make sure your MinGW / bin directory is part of the PATH environment variable, so you can call the compiler from anywhere.
At the command prompt, change to the directory containing the source code. From there enter the command
mingw32-gcc -O2 -c [files] -I[header directory]
You must either specify [files] specifically, -c a.cpp b.cpp c.cpp , or you can identify them all with *.cpp . [header directory] where the .h files for the source are relative to you. Typically, the source files will be in the directory themselves / src and the header files in a sister directory called / include. You reference this directory as -I../include . If the header files are in the / include directory in the / src directory, this will be -Iinclude .
Once you have generated the .o files, enter the command
ar rcs lib[something].a [files]
Replace [something] with the name of the library. This is the name that will appear in the Link Libraries dialog box in Code :: Blocks. Files is either the name of previously created object files (ao, bo, co), or if there are no unrelated object files in the directory, you can enter *.o .
This should lead to the creation of an archive file in the directory. Now you can put it in the appropriate directory (possibly the sisters directory for / include called / lib) and add this directory to the Code :: Blocks configuration in the link lookup directories. Then you should remember how to add a library project for you.