陈奕涛
GTS install on mac
2016-3-23 22:24
阅读:3477

1. Install Glib

  Run in Terminal:

  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

  Run:

  brew install glib

 (the installation path: /usr/local/Cellar/glib)



2. test Glib

  Run:

  gcc `pkg-config --cflags --libs glib-2.0` -o test test.c


  test.c: 

  #include <stdio.h>

  #include <glib.h>

  int main(int argc, char** argv) {

     GList* list = NULL;

      list = g_list_append(list, "Hello world!");

      char* str = g_list_first(list)->data;

      printf("The first item is '%s'n", str);

      return 0;

  }


3. Install GTS

  code: https://sourceforge.net/projects/gts/

 

  Run:

  cd gts-0.7.6

  ./configure

  make

  make install



4. Test GTS

  in 'example' folder and Run:

  ./cartesian --help




reference:

http://macappstore.org/glib/

http://askubuntu.com/questions/90338/how-to-compile-a-helloworld-glib-program 

http://stackoverflow.com/questions/11466904/using-glib-library-in-c-program

http://gts.sourceforge.net/install.html 



转载本文请联系原作者获取授权,同时请注明本文来自陈奕涛科学网博客。

链接地址:https://wap.sciencenet.cn/blog-452843-964490.html?mobile=1

收藏

分享到:

当前推荐数:0
推荐到博客首页
网友评论0 条评论
确定删除指定的回复吗?
确定删除本博文吗?