c++问题,有耐心的人请进
天地一棵树 2009-10-17 11:02:27 编译出现这个问题,
我用的2008版的编译环境
代码如下
#include<iostream>
using namespace std;
class Furniture
{
public:
Furniture(){}
void SetWeight(int i){weight=i;}
int GetWeight(){return weight;}
protected:
int weight;
};
class Bed:virtual public Furniture
{
public:
Bed(){}
void Sleep(){cout<<"Sleeping...\n";}
};
class Sofa:virtual public Furniture
{
public:
Sofa(){}
void WatchTV(){cout<<"Watching TV.\n";}
};
class SleeperSofa:public Bed,public Sofa
{
public:
SleeperSofa():Sofa(),Bed(){}
void FoldOut(){cout<<"Flod out the sofa.\n";}
};
void main()
{
SleeperSofa ss;
ss.SetWeight(20);
cout<<"ss.GetWeight()"<<endl;
}
编译时出现如下错误
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
Build log was saved at "file://d:\个人重要资料(勿删)\Administrator\桌面\dgkgdgf\dgkgdgf\Debug\BuildLog.htm"
dgkgdgf - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========