我正在尝试从 1988 年开始编译一个程序。该程序从计算机断层扫描类型的实验中计算二维重建 - 只有它考虑了光的一阶衍射。我在那里上传了档案:
http://ubuntuone.com/1LXF5SBtUToJZ2lSgGJS47
它包含三个文件夹:
Lib - libraries
Man - manuals on the programs
Src - the actual source scripts
Src
and都Lib
包含一个. Makefile
当我尝试编译时,我得到:
/Src$ make
ncc david.c -g -o david libuis.a -lm
make: ncc: Command not found
make: *** [david] Error 127
[编辑] 正如 alexandernst 所建议的,我在 Makefile 中安装了nescc并用 nescc 替换了 ncc。
该文件libuis
位于Lib
. 当我尝试编译时:
/Lib$ make
make: `libuis' is up to date.
[编辑]
根据 greghnz 的建议,我复制Lib/libuis
到Src/libuis.a
.
[编辑]
正如 Evert 所建议的,我符号链接Lib/diffract.h
到Src/diffract.h
并且编译更进一步。
当我现在尝试编译时,我得到:
nescc david.c -g -o david libuis.a -lm
In file included from david.c:1:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
david.c: In function ‘main’:
david.c:93:5: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
david.c:177:4: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
david.c:200:8: warning: extra tokens at end of #endif directive [enabled by default]
david.c:400:8: warning: extra tokens at end of #endif directive [enabled by default]
david.c: In function ‘syntax’:
david.c:466:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
libuis.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
make: *** [david] Error 1
我跑了(我不知道那是做什么的)
ranlib libuis.a
并没有返回任何东西。当我重命名Lib/libuis
并尝试编译它时,我得到了这个:
nescc -c -g FFTUnpack.c UnWrap.c UnWrap2d.c cfft.c cfft2d.c chamming.c cmodulate.c comm.c complex.c ctranspose.c debug.c ellipse.c fft.c fft2d.c findpoint.c findray.c findscat.c fmax.c fmin.c hamming.c mode.c modulate.c numout.c picout.c syntax.c transpose.c Green.c
In file included from UnWrap.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
UnWrap.c: In function ‘UnWrap’:
UnWrap.c:88:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
UnWrap.c:147:8: warning: extra tokens at end of #endif directive [enabled by default]
UnWrap.c: In function ‘PhaseRecurse’:
UnWrap.c:330:3: warning: incompatible implicit declaration of built-in function ‘abort’ [enabled by default]
UnWrap.c:346:8: warning: extra tokens at end of #endif directive [enabled by default]
UnWrap.c: At top level:
UnWrap.c:454:8: warning: extra tokens at end of #endif directive [enabled by default]
UnWrap.c:488:8: warning: extra tokens at end of #endif directive [enabled by default]
In file included from UnWrap2d.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
UnWrap2d.c: In function ‘UnWrap2d’:
UnWrap2d.c:48:8: warning: extra tokens at end of #endif directive [enabled by default]
In file included from cfft.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from cfft2d.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from chamming.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from cmodulate.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from comm.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
comm.c: In function ‘comm’:
comm.c:28:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
In file included from complex.c:15:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from ctranspose.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from ellipse.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
ellipse.c: In function ‘readellipses’:
ellipse.c:33:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
ellipse.c:38:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
fft.c: In function ‘fft’:
fft.c:39:15: warning: conflicting types for built-in function ‘sin’ [enabled by default]
fft.c:39:22: warning: conflicting types for built-in function ‘cos’ [enabled by default]
In file included from findpoint.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from findray.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
findray.c: In function ‘findray’:
findray.c:147:4: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
In file included from findscat.c:16:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
findscat.c: In function ‘findscat’:
findscat.c:187:3: warning: incompatible implicit declaration of built-in function ‘abort’ [enabled by default]
findscat.c:187:3: error: too many arguments to function ‘abort’
findscat.c:197:3: warning: incompatible implicit declaration of built-in function ‘abort’ [enabled by default]
findscat.c:197:3: error: too many arguments to function ‘abort’
findscat.c:207:4: warning: incompatible implicit declaration of built-in function ‘abort’ [enabled by default]
findscat.c:207:4: error: too many arguments to function ‘abort’
findscat.c: At top level:
findscat.c:303:7: warning: extra tokens at end of #else directive [enabled by default]
findscat.c:314:8: warning: extra tokens at end of #endif directive [enabled by default]
In file included from hamming.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
In file included from mode.c:14:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
numout.c:31:8: warning: extra tokens at end of #endif directive [enabled by default]
picout.c: In function ‘picout’:
picout.c:29:4: warning: passing argument 2 of ‘fwrite’ makes integer from pointer without a cast [enabled by default]
In file included from picout.c:17:0:
/usr/include/stdio.h:715:15: note: expected ‘size_t’ but argument is of type ‘char *’
picout.c:29:4: error: too few arguments to function ‘fwrite’
picout.c:30:4: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
syntax.c: In function ‘syntax’:
syntax.c:15:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
In file included from Green.c:5:0:
diffract.h:41:57: warning: conflicting types for built-in function ‘csqrt’ [enabled by default]
diffract.h:42:43: warning: conflicting types for built-in function ‘cexp’ [enabled by default]
Green.c: In function ‘Green’:
Green.c:37:27: warning: incompatible implicit declaration of built-in function ‘malloc’ [enabled by default]
Green.c:58:8: warning: extra tokens at end of #endif directive [enabled by default]
Green.c:59:27: warning: incompatible implicit declaration of built-in function ‘malloc’ [enabled by default]
Green.c:63:5: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
Green.c:89:3: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
make: *** [libuis] Error 1
我假设我必须在我的机器上编译libuis才能工作?干杯,保罗