Build .so file from .c file using gcc command line

I’m trying to create a hello world project for Linux dynamic libraries (.so files). So I have a file hello.c:

#include <stdio.h>
void hello()
    printf("Hello world!\n");

How do I create a .so file that exports hello(), using gcc from the command line?

1 Answer

Leave a Comment