Search code examples
c++c++11headervisual-studio-express

My libraries are not recognized in visual studio Express 2015


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


Solution

  • 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.