$/> mkdir build
$/> cd build
$/> cmake ..
$/> make
$/> make test
$/> sudo make install
then you will have gtlib in your system
#include <stdio.h>
#include <stdlib.h>
#include <gt/gtstack.h>
int main(){
GtStack* stack = gt_stack_create(10);
gt_stack_push(stack, "顺丰");
gt_stack_push(stack, "韵达");
gt_stack_push(stack, "申通");
gt_stack_push(stack, "圆通");
GtValue p;
int err;
while((err=gt_stack_pop(stack, &p))==GT_STATUS_OK){
printf("pop:%s\n", (char*)p);
}
gt_stack_destroy(&stack);
return EXIT_SUCCESS;
}
$ />clang main.c `pkg-config --cflags --libs gtlib`