Compile with custom library II

2 months ago, I mentioned compiling C projects with custom library, such as genlib, simpio and strlib by including the .h header files and .c implementation files in the compilation folder. However, I made a mistake (not mistake actually, but a boob). It’s obviously not an efficient way to copy all .h and .c files in the compilation folder for each project, unless you wanna make it portable.

Fortunately, I found a better way to have fun with custom library.

In the meantime, I am still using GUI IDE for C programming (Code::Blocks) instead of using command line and scripts. Therefore, this “better way" is to tell the compiler (of Code::Blocks) (Not writing a script) where is the library located.

To include a directory, where the library files (headers and implementation files) are located, in the compiler’s usable library list.

Just 3 steps and it’s done. You can now and ever use the common custom library for all C projects and do not need to copying them into each project folder every time.

One thought on “Compile with custom library II

  1. It is appropriate time to make some plans for the future and it’s time to be happy. I have read this post and if I could I desire to suggest you some interesting things or advice. Perhaps you could write next articles referring to this article. I want to read more things about it!


在下方填入你的資料或按右方圖示以社群網站登入: Logo

您的留言將使用 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )


您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s