-1

I am doing a c++ assignment and I am using visual studio express. In my header.h file I have the following libraries:

#include <cstdlib>
#include<iostream>
#include <cstring>
#include<fstream>
#include<string>
#include <vector> 
#include<iomanip>

#ifndef _HEADER_H_
#define _HEADER_H_

using namespace std;

and on my main.cpp and Source.cpp I have a reference to the Header.h:

#include"Header.h"

It seams that the libraries are not recognized since I get the following errors:

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'   

However the project runs fine in Visual studio professional. But we have been asked to do it in Express.

Please help Thank you

Jonathan Potter
  • 36,172
  • 4
  • 64
  • 79
Beslinda N.
  • 4,808
  • 5
  • 27
  • 33

1 Answers1

3

The failing code would be nice, but it looks as if you are missing the

#include <sstream>

header. The full suite seems to have that included in some other header file, hence the different behavior.

nikolas
  • 8,707
  • 9
  • 50
  • 70