Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Dev Tools

GCC (c compiler)

The c compiler on most Unix systems is the GNU C Compiler (gcc).

Here is a classic program written in c:

#include <stdio.h>

int main(){
  printf("Hello, World!\n");
}

You can compile it by saving it in a file ending with a .c extension, and then running:

cc -o hello hello.c

Shared Libraries

Shared libraries have a .so extension (shared object)

You can see what shared libraries a program uses by running ldd:

ryan:notes/  |main ?:1 ✗|$ ldd /bin/bash
        linux-vdso.so.1 (0x00007fff758ab000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fae9d281000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fae9d059000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fae9d429000)