读书人

程序运作不出求解释

发布时间: 2012-09-24 13:49:41 作者: rapoo

程序运行不出,求解释
程序如下:
#include"stdio.h"
#include"conio.h"
main(void)
{
int color;
for(color=0;color<8;color++)
{
textbackground(color);
cprintf("This is color %d\r\n",color);
cprintf("Press any key to continue\r\n");
getch();
}
}

显示的错误:
--------------------Configuration: myprogram30 - Win32 Debug--------------------
Linking...
myprogram30.obj : error LNK2001: unresolved external symbol _textbackground
Debug/myprogram30.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.

myprogram30.exe - 1 error(s), 0 warning(s)

请问为什么会出错,怎么改?

[解决办法]
textbackground函数未定义,查textbackground哪里定义的,或者自己定义一个。
[解决办法]
你的函数没有在你的头文件里
[解决办法]
用textbackground函数的话,需要在Turbo C下编译。
[解决办法]
error LNK2001: unresolved external symbol _textbackground

[解决办法]
编译环境很重要。

读书人网 >C语言

热点推荐