3
我試圖編譯在C MathGL庫的第一個例子:編譯mathgl C-例
http://mathgl.sourceforge.net/doc_en/Examples.html
#include <mgl2/mgl_cf.h>
int main()
{
HMGL gr = mgl_create_graph(600,400);
mgl_fplot(gr,"sin(pi*x)","","");
mgl_write_frame(gr,"test.png","");
mgl_delete_graph(gr);
}
我安裝使用aptitude libmgl-dev的,並拒絕提供的第一個選項,因爲aptitude想要刪除一些不同的程序並接受第二個選項,它只升級了一些。
如果我嘗試編譯:
gcc test.c -o test -lmgl
In file included from /usr/include/mgl2/mgl_cf.h:29:0,
from test.c:1:
/usr/include/mgl2/data_cf.h:318:78: error: unknown type name ‘bool’
EXPORT mgl_fft(double *x, long s, long n, const void *wt, void *ws, bool inv);
於是,我就添加#include <stdbool.h>
並試圖像-std=gnu11
或-std=c11
和-std=c99
標誌。沒有一個工作。我試着添加國旗-lmgl
(我甚至讀過,我應該把它放在最後)。
我該如何編譯這個例子?
好吧我重新從源代碼,它工作正常。我會把它報告給薄荷作爲一個錯誤。 – Stein