我在GTK和gtksourceview2.0中编写简单的代码编辑器.我想在编辑器中添加一个代码完成窗口.应该有10-15个关键字(总是相同).
任何人都可以给我一些教程的url或描述gtk_source_completion_XXX函数的用法吗?
我有个问题.我编写了示例代码,我想在没有错误的情况下构建它:
main.cpp(.text+0x5): undefined reference to `test()'
Run Code Online (Sandbox Code Playgroud)
图书馆
test1.c
#include <stdlib.h>
void test()
{
puts("Dzia?a");
}
Run Code Online (Sandbox Code Playgroud)
test1.h
#ifndef TEST1_H
#define TEST1_H
extern void test();
#endif
Run Code Online (Sandbox Code Playgroud)
生成文件
all:
gcc -c ./src/test1.c -o ./lib/test1.o
ar rcs ./lib/libtest1.a ./lib/test1.o
Run Code Online (Sandbox Code Playgroud)
程序
main.cpp中
#include <test1.h>
int main()
{
test();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
生成文件
all:
g++ -static -I../test1/include -L../test1/lib ./src/main.cpp -o ./build/MyApp -ltest1
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?