2019年10月2日 星期三

Create a shared library on Linux

1. Library source code (file name: pos_conf.c)
    #include <stdio.h>
    void pos (void)
    {
        printf("/home/owen/codeblocks_prj/lib\n");
    }

2. Shared library compiling
    gcc -o libpos.so -fPIC -shared pos_conf.c
    or
    gcc -fPIC -c pos_conf.c
    gcc -o libpos.so -shared pos_conf.o

3. Main function
    void pos(void);
    int main (void)
    {
        pos();
        return 0;
    }

4. Main executable compling
    gcc -o pos.exe main.c -lpos -L.
    or
    gcc -o pos.exe main.c libpos.so

[Note]
Add the running time library path
gcc -o pos.exe main.c -lpos -L. -Wl,-rpath,/home/owen/codeblocks_prj/lib

2019年9月30日 星期一

A cool weather website

Earth Nullschool
https://earth.nullschool.net/

licensing
contact inquiries@nullschool.net for licensing or other questions