我正在使用ubuntu系统。我的目标是基本上使用TCL/TK的GUI工具制作C语言IDE。我安装了tcl 8.4,tk8.4,tcl8.4-dev,tk8.4-dev,并在我的系统中安装了tk.h和tcl.h头文件。但是,当我运行一个基本的Hello World程序时,它显示出很多错误。包括c程序中的tk.h和tcl.h
#include "tk.h"
#include "stdio.h"
void hello() {
puts("Hello C++/Tk!");
}
int main(int, char *argv[])
{
init(argv[0]);
button(".b") -text("Say Hello") -command(hello);
pack(".b") -padx(20) -pady(6);
}
有些错误是
tkDecls.h:644: error: expected declaration specifiers before ‘EXTERN’
/usr/include/libio.h:488: error: expected ‘)’ before ‘*’ token
In file included from tk.h:1559,
from new1.c:1:
tkDecls.h:1196: error: storage class specified for parameter ‘TkStubs’
tkDecls.h:1201: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/stdio.h:145: error: storage class specified for parameter ‘stdin’
tk.h:1273: error: declaration for parameter ‘Tk_PhotoHandle’ but no such parameter
谁能告诉我怎样才能纠正这些错误?请帮忙...