私はubuntuシステムに取り組んでいます。私の目標は、基本的に TCL/TK の GUI ツールを使用して C 言語で IDE を作成することです。tcl 8.4、tk8.4、tcl8.4-dev、tk8.4-dev をインストールし、システムに tk.h および tcl.h ヘッダー ファイルを作成しました。しかし、基本的な hello world プログラムを実行すると、非常に多くのエラーが表示されます。
#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
これらのエラーを修正する方法を教えてください。助けてください...