When compiling, gcc may output many error messages which are dazzling. Although you can locate the error in the source code in the end, you may never notice the details […]

I have a big misunderstanding about make. I thought if I run “make” or “make -f Makefile”, make will check the first target in the makefile and possibly update targets […]

How to build a shared library using gcc/g++?Building a shared library with gcc is easy but it takes 2 steps: gcc -c -fpic mytools.c gcc -shared -o libmytools.so mytools.o The […]

We know an ordinary member function can not be defined multiple times. Suppose you have the following 3 files a.h, a.cpp, and main.cpp: //a.h #ifndef A_H #define A_H #include <iostream> […]