OK, I found the reason and solved the problem.
I found that there are two files in the devel folder:
libcodeblocks.dll.a
and
libcodeblocks.a
The former one was an old file, and the later one was using right now, but the former one has more priority for the linker.
PS: Why we have to change the name scheme from libXXXX.dll.a to libXXXX.a? The former one indicates it's a dll export library.