VS2005 Test一堆的错误提示
大家好。
我在学习使用VS2005的Test框架,自己找了一个例子,《Essential C++》第四章第一节的代码,想应用一下Test框架。但是编译的时候出了一堆的错误,好像是和头文件的#include有关吧。
一个Win32控制台项目。
//Stack.h
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Stack{
public:
bool push(const string&);
bool pop(string &elem);
bool peek(string &elem);
bool find(const string &);
int count (const string &);
bool empty();
bool full();
int size() {return _stack.size();}
private:
vector<string> _stack;
};
//Stack.cpp
#include "Stack.h"
inline bool Stack::empty()
{
return _stack.empty();
}
bool Stack::pop(string &elem)
{
if (empty())
return false;
elem=_stack.back();
_stack.pop_back();
return true;
}
inline bool Stack::full()
{
return _stack.size()==_stack.max_size();
}
bool Stack::peek(string &elem)
{
if (empty())
return false;
elem=_stack.back();
return true;
}
bool Stack::push(const string &elem)
{
if (full())
return false;
_stack.push_back(elem);
return true;
}
bool Stack::find(const string &elem)
{
for (int ix=0;ix<_stack.size();++ix)
{
if (_stack[ix]==elem)
return true;
}
return false;
}
int Stack::count (const string &elem)
{
int count_num=0;
for (int ix=0;ix<_stack.size();++ix)
if (_stack[ix]==elem)
count_num++;
return count_num;
}
然后就是用菜单的Test项增加一个相关的测试项目StackTest。
给这个项目下的 StackTest.cpp增加一句:
#include "../Stack/Stack.h"
然后编译就会出现一堆的错误。
如果注释掉Stack.h的几个#include,之前的编译错误就会消失,怎么回事呢?
谢谢!
[解决办法]
顶一个,期待有人解答。
[解决办法]
把错误提示也贴出来嘛
[解决办法]
3170个错误,不方便全贴出来。
贴前几个吧:
1>C:\CAx\App\Microsoft Visual Studio 8\VC\include\vadefs.h(89) : error C4956: 'va_list *' : this type is not verifiable
1>C:\CAx\App\Microsoft Visual Studio 8\VC\include\vadefs.h(90) : error C4956: 'va_list *' : this type is not verifiable
1>C:\CAx\App\Microsoft Visual Studio 8\VC\include\vadefs.h(90) : error C4956: 'void *(va_list *,...)' : this type is not verifiable
1>C:\CAx\App\Microsoft Visual Studio 8\VC\include\vadefs.h(91) : error C4956: 'va_list *' : this type is not verifiable
1>C:\CAx\App\Microsoft Visual Studio 8\VC\include\crtdefs.h(2037) : error C4956: 'threadlocaleinfostruct *' : this type is not verifiable
[解决办法]
沉得真快啊。
我顶!
等待,在等待....
[解决办法]
没人人回答,我就结贴了。
------解决方案--------------------
解决了吗?我也遇到了