照着MIRAC说明文档上的内容复制的程序不能link成功,显示:
--------------------Configuration: dddd - Win32 Debug--------------------
Compiling...
dddd.c
Linking...
dddd.obj : error LNK2001: unresolved external symbol _otnum
dddd.obj : error LNK2001: unresolved external symbol _premult
dddd.obj : error LNK2001: unresolved external symbol _mirvar
dddd.obj : error LNK2001: unresolved external symbol _mirsys
Debug/dddd.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
dddd.exe - 5 error(s), 0 warning(s)
源代码如下:
/*
* Program to calculate factorials.
*/
#include <stdio.h>
#include <miracl.h> /* include MIRACL system */
void main()
{ /* calculate factorial of number */
big nf; /* declare "big" variable nf */
int n;
miracl *mip=mirsys(5000,10);
/* base 10, 5000 digits per big */
nf=mirvar(1); /* initialise big variable nf=1 */
printf("factorial program\n");
printf("input number n= \n");
scanf("%d",&n);
getchar();
while (n>1)
premult(nf,n--,nf); /* nf=n!=n*(n-1)*...2*1 */
printf("n!= \n");
otnum(nf,stdout); /* output result */
}
请高手指点
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课