Thursday, August 23, 2012

个人第一个github项目

今天终于在github上有了一个真正的自己的项目,虽然是一个很简单,很小的项目,不过还是值得纪念一下。

项目地址: https://github.com/yongzhy/goploticus

这个是libploticus的Go语言封装。

ploticus的主页

A free, GPL, non-interactive software package for producing plots, charts, and graphics from data. It was developed in a Unix/C environment and runs onvarious Unix, Linux, and win32 systems. ploticus is good for automated or just-in-time graph generation, handles date and time data nicely, and has basic statistical capabilities. It allows significant user control over colors, styles, options and details. Ploticus is a mature package, available since 1999, and version 2.40 has more than 12,000 downloads to date. Ploticus was discussed in this 2008 review on Linux.com.

因为是第一次封装C的API,折腾了一阵子才发现要让cgo编译代码,import “C” 必须是单独一行.

可以编辑的代码:

  1. //#cgo LDFLAGS: -lploticus

  2. //#include <libploticus.h>

  3. //#include <stdlib.h>

  4. import "C"

不可以被编辑的代码:

  1. //#cgo LDFLAGS: -lploticus

  2. //#include <libploticus.h>

  3. //#include <stdlib.h>

  4. import (

  5. "C"

  6. )

什么东西,都要试了才真正知道。

No comments: