visual studio Express 2015 无法识别我的库
My libraries are not recognized in visual studio Express 2015
我正在做 C++ 作业,我正在使用 visual studio express。在我的 header.h 文件中,我有以下库:
#include <cstdlib>
#include<iostream>
#include <cstring>
#include<fstream>
#include<string>
#include <vector>
#include<iomanip>
#ifndef _HEADER_H_
#define _HEADER_H_
using namespace std;
在我的 main.cpp 和 Source.cpp 上,我参考了 Header.h:
#include"Header.h"
由于出现以下错误,库似乎无法识别:
Severity Code Description Project File Line
Error C2079 'ss' uses undefined class 'std::basic_stringstream<char,std::char_traits<char>,std::allocator<char>>'
Error C2440 'initializing': cannot convert from 'std::string' to 'int'
Error C2780 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)': expects 2 arguments - 3 provided
Error C2784 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)': could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'int'
Error C2780 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &&,std::basic_string<_Elem,_Traits,_Alloc> &)': expects 2 arguments - 3 provided
Error C2784 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &&,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)': could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &&' from 'int'
Error C2780 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)': expects 2 arguments - 3 provided
Error C2784 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)': could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'int'
但是该项目在 Visual studio 专业版中运行良好。但是我们被要求在 Express 中这样做。
请帮忙
谢谢
失败的代码会很好,但看起来你好像遗漏了
#include <sstream>
header。完整套件似乎包含在其他一些 header 文件中,因此行为不同。
我正在做 C++ 作业,我正在使用 visual studio express。在我的 header.h 文件中,我有以下库:
#include <cstdlib>
#include<iostream>
#include <cstring>
#include<fstream>
#include<string>
#include <vector>
#include<iomanip>
#ifndef _HEADER_H_
#define _HEADER_H_
using namespace std;
在我的 main.cpp 和 Source.cpp 上,我参考了 Header.h:
#include"Header.h"
由于出现以下错误,库似乎无法识别:
Severity Code Description Project File Line
Error C2079 'ss' uses undefined class 'std::basic_stringstream<char,std::char_traits<char>,std::allocator<char>>'
Error C2440 'initializing': cannot convert from 'std::string' to 'int'
Error C2780 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)': expects 2 arguments - 3 provided
Error C2784 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)': could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'int'
Error C2780 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &&,std::basic_string<_Elem,_Traits,_Alloc> &)': expects 2 arguments - 3 provided
Error C2784 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &&,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)': could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &&' from 'int'
Error C2780 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)': expects 2 arguments - 3 provided
Error C2784 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)': could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'int'
但是该项目在 Visual studio 专业版中运行良好。但是我们被要求在 Express 中这样做。
请帮忙 谢谢
失败的代码会很好,但看起来你好像遗漏了
#include <sstream>
header。完整套件似乎包含在其他一些 header 文件中,因此行为不同。