Open sheldonlyr opened 7 years ago
Because
gcc main.c -std=c99 -Wall -g -o example -lzlog -lpthread -static
The -static
would make libpthread be static linked, then your program would always crash.
If you want to static link zlog only, you probably could use this
gcc main.c -std=c99 -Wall -g -o example /path/to/libzlog.a -lpthread
Though it has been four years, hope someone still cares about this.
This is source file:
Build command:
This is configuration file:
gcc version:
After build, run binary file, it crashed immediately.