很简单的一个程序,vc6.0 build不过去
#include <iostream>
#include <math.h>
using namespace std;
class box{
private:
int length, heigth,weigth;
int volum;
public:
box( int x, int y, int z);
~box();
int vol ( )
{
volum= length*heigth*weigth;
cout<<"vol is"<<volum<<endl;
return 0;
}
};
box::box(int x,int y, int z)
{
length =x;
heigth =y;
weigth =z;
}
main()
{
box a(10,20,5);
a.vol();
return 0;
}
===========================================
--------------------Configuration: p_89 - Win32 Debug--------------------
Linking...
exercise.obj : error LNK2001: unresolved external symbol "public: __thiscall box::~box(void)" (??1box@@QAE@XZ)
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/p_89.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
p_89.exe - 3 error(s), 0 warning(s)