好奇怪阿.一段代码..编译cpp是没问题的
构造.exe就出现4个错误..
WHY阿..还没遇到这种鬼事情
我用VC6
各位高手有时间来T俺一脚阿代码如下#include<iostream.h>
struct complex
{
double real;
double imaginary;
};
void main(void)
{
int m,n;
double x,y;
complex c1,c2,c3;
int add(int m, int n);
double add(double x,double y);
complex add(complex c1,complex c2);
cout<<"Enter two integer:";
cin>>m>>n;
cout<<"integer"<<m<<"+"<<n<<"="<<add(m,n)<<endl;
cout<<"Enter two real number:";
cin>>x>>y;
cout<<"real number"<<x<<'+'<<y<<"= "<<add(x,y)<<endl;
cout<<"Enter the first complex number:";
cin>>c1.real>>c1.imaginary;
cout<<"Enter the second complex number:";
cin>>c2.real>>c2.imaginary;
c3=add(c1,c2);
cout<<"complex number("<<c1.real<<','<<c1.imaginary<<")+("<<c2.real<<','<<c2.imaginary<<")=("<<c3.real<<','<<c3.imaginary<<")\n";
}错误如下
--------------------Configuration: index - Win32 Debug--------------------
Linking...
indexx.obj : error LNK2001: unresolved external symbol "struct complex __cdecl add(struct complex,struct complex)" (?add@@YA?AUcomplex@@U1@0@Z)
indexx.obj : error LNK2001: unresolved external symbol "double __cdecl add(double,double)" (?add@@YANNN@Z)
indexx.obj : error LNK2001: unresolved external symbol "int __cdecl add(int,int)" (?add@@YAHHH@Z)
Debug/index.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.index.exe - 4 error(s), 0 warning(s)
构造.exe就出现4个错误..
WHY阿..还没遇到这种鬼事情
我用VC6
各位高手有时间来T俺一脚阿代码如下#include<iostream.h>
struct complex
{
double real;
double imaginary;
};
void main(void)
{
int m,n;
double x,y;
complex c1,c2,c3;
int add(int m, int n);
double add(double x,double y);
complex add(complex c1,complex c2);
cout<<"Enter two integer:";
cin>>m>>n;
cout<<"integer"<<m<<"+"<<n<<"="<<add(m,n)<<endl;
cout<<"Enter two real number:";
cin>>x>>y;
cout<<"real number"<<x<<'+'<<y<<"= "<<add(x,y)<<endl;
cout<<"Enter the first complex number:";
cin>>c1.real>>c1.imaginary;
cout<<"Enter the second complex number:";
cin>>c2.real>>c2.imaginary;
c3=add(c1,c2);
cout<<"complex number("<<c1.real<<','<<c1.imaginary<<")+("<<c2.real<<','<<c2.imaginary<<")=("<<c3.real<<','<<c3.imaginary<<")\n";
}错误如下
--------------------Configuration: index - Win32 Debug--------------------
Linking...
indexx.obj : error LNK2001: unresolved external symbol "struct complex __cdecl add(struct complex,struct complex)" (?add@@YA?AUcomplex@@U1@0@Z)
indexx.obj : error LNK2001: unresolved external symbol "double __cdecl add(double,double)" (?add@@YANNN@Z)
indexx.obj : error LNK2001: unresolved external symbol "int __cdecl add(int,int)" (?add@@YAHHH@Z)
Debug/index.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.index.exe - 4 error(s), 0 warning(s)
解决方案 »
- 如何让两台电脑共用一个音箱?
- /*/*/*/*/*因工作需要,要做一个小的排考场系统,但不知如何下手,请高手指教*/*/*/*/*/
- 我真的不知道,别骂我,20分,vc和vc++一样么?
- 调用delphi写的DLL抛出异常访问异常,怎么解决?
- 我想控制别的应用程序,有什么办法可以实现自动登陆别的程序吗????
- USES_CONVERSION是什么,怎么用,要包含哪个文件?
- 大家帮我看看为什么检查道第一个可用端口就不能继续扫描了
- 求助:一个关于图标显示的问题。(开始提的一个没有上去,:9)
- 请问~~~~~~~~~~~恩,还是进来看看吧
- 手头有dll及函数声名,用implib.exe生成.lib后是不是把他放到lib文件夹后就行
- 解决方案--图像与文字的合成
- 数据包加头问题!
2楼的什么对复数的运算阿?我在学习函数重载阿