用eclipse+cdt开发gtk程序,链接时报错...无奈了
**** Build of configuration Debug for project gtk_test ****
make all
Building file: ../c.c
Invoking: GCC C Compiler
gcc -O0 `pkg-config --cflags --libs gtk+-2.0` -MMD -MP -MF"c.d" -MT"c.d" -o"c.o" "../c.c"
Finished building: ../c.c
Building target: gtk_test
Invoking: GCC C Linker
gcc -nostartfiles `pkg-config --libs gtk+-2.0` -o"gtk_test" ./c.o
./c.o: In function `_edata':
(*ABS*+0x8049820): multiple definition of `__bss_start'
./c.o: In function `_end':
(*ABS*+0x8049824): multiple definition of `_end'
./c.o: In function `_edata':
(*ABS*+0x8049820): multiple definition of `_edata'
collect2: ld returned 1 exit status
make: *** [gtk_test] Error 1
[解决办法]
pkg-config --libs gtk+-2.0
看看路径和版本对上不?
要不你直接把gtk+-2.0的路径加到
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/mygtkdir
试试看
[解决办法]
这个错误,好像是说“multiple definition 重复定义”?