Code::Blocks links to libstdc++ and libgcc by default when compiling C code. That's really unnecessary for a default behavior I think.
Test:
avidan@avidebian:~$ cat hello.c
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
avidan@avidebian:~$ codeblocks --build hello.c
Compiling: /home/avidan/hello.c
Linking console executable: /home/avidan/hello
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
avidan@avidebian:~$ ldd hello
linux-vdso.so.1 => (0x00007fffe18c6000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6cc090f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6cc068d000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6cc0476000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6cc00ef000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6cc0c39000)
avidan@avidebian:~$ # Build manually using GCC
avidan@avidebian:~$ gcc hello.c -o hello
avidan@avidebian:~$ ldd hello
linux-vdso.so.1 => (0x00007fff9b537000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f98e5ade000)
/lib64/ld-linux-x86-64.so.2 (0x00007f98e5e88000)
avidan@avidebian:~$ rm hello*
avidan@avidebian:~$
It also links to libm, but that's perhaps good to avoid confusion, and because the math library is just used too often. I can't understand why it links to libgcc and especially libstdc++ by default when compiling C code. Is there any way to disable the linking of these libraries?