我正在尝试安装本书附带的代码:https://sites.google.com/site/cinterfacesimplementations/
按照作者在此处给出的说明进行操作:http://cii.googlecode.com/svn/trunk/install.html
我的电脑在 32 位 i686 架构上安装了 ubuntu 11.04。按照作者对我尝试的 32 位 linux 的说明进行操作:
make CC='cc -DMAXALIGN=4' AS='cc -c -x assembler-with-cpp -traditional'
其中cc是gcc版本4.5.2 其中给出了以下警告和错误:
makefile:138: warning: overriding commands for target `maxalign'
makefile:135: warning: ignoring old cc -DMAXALIGN=4 -g -Iinclude -c -o ap.o src/ap.c
In file included from src/thread.c:100:0:
/usr/include/i386-linux-gnu/asm/sigcontext.h:56:8: error: redefinition of ‘struct _fpreg’
/usr/include/bits/sigcontext.h:28:8: note: originally defined here
/usr/include/i386-linux-gnu/asm/sigcontext.h:61:8: error: redefinition of ‘struct _fpxreg’
/usr/include/bits/sigcontext.h:34:8: note: originally defined here
/usr/include/i386-linux-gnu/asm/sigcontext.h:67:8: error: redefinition of ‘struct _xmmreg’
/usr/include/bits/sigcontext.h:41:8: note: originally defined here
/usr/include/i386-linux-gnu/asm/sigcontext.h:71:8: error: redefinition of ‘struct _fpstate’
/usr/include/bits/sigcontext.h:50:8: note: originally defined here
/usr/include/i386-linux-gnu/asm/sigcontext.h:104:8: error: redefinition of ‘struct sigcontext’
/usr/include/bits/sigcontext.h:81:8: note: originally defined here
src/thread.c: In function ‘interrupt’:
src/thread.c:108:2: warning: ‘sigsetmask’ is deprecated (declared at /usr/include/signal.h:199)
make: *** [thread.o] Error 1
不确定在这里做什么。 同样令人费解的是/usr/include/i386-linux-gnu。因为如果我这样做
uname -m
它打印 i686 而不是 i363。 有什么想法吗?
干杯, 吉姆
最佳答案
在 thread.c 的第 100 行——删除 #include <asm/sigcontext.h>
(或将其注释掉)。那应该删除“重复声明”。它不会修复不推荐使用的接口(interface)的使用(十年前写的书和 5 年前更新的代码的问题),如果您尝试在 64 位处理器上运行它,则会出现其他我没有尝试修复的问题.
关于c - 'c interfaces and implementations' (David Hanson) 代码安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14533191/