新问题,高手请进!
下面这个程序,编译通过了,连接的时候有一个错误.(小弟正在看c语言的科学和艺术一书,程序都是书里的),我用的vc++6.0编译器/*
* File: greeting.c
* ----------------
* This program prints a more personal greeting than did
* the original "Hello, world." program by reading in the
* name of the user.
*/
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
void main()
{
string user;
printf("What is your name? ");
user = GetLine();
printf("Hello, %s.\n", user);
}
出现的错误:
-Configuration: 33w3 - Win32 Debug--------------------
Linking...
33w3.obj : error LNK2001: unresolved external symbol "char * __cdecl GetLine(void)" (?GetLine@@YAPADXZ)
Debug/33w3.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
33w3.exe - 1 error(s), 0 warning(s)
附上了simpio.h头文件
[[it] 本帖最后由 yshwy2008 于 2008-6-13 20:18 编辑 [/it]]