Reputation: 6535
I am trying my hands on sample codes from a book, and so I am not entirely sure what I may have wrong in the header file I have so far.
I keep getting the following error messages.
Error 2 error C2061: syntax error : identifier 'streambuf'
Error 1 error C2504: 'ios' : base class undefined
Error 5 IntelliSense: identifier "streambuf" is undefined
// StdAfx.h HEADER FILE
**************************
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include <iostream>
#include <strstream>
#include <iomanip>
#include <ios>
#include <stdio.h>
#include <tchar.h>
#include "targetver.h"
// Conios HEADER FILE
**************************
#include "Stdafx.h"
class Conios :virtual public ios{
protected:
public:
Conios(void);
~Conios(void);
Conios(streambuf* Buffer);
};
Upvotes: 0
Views: 928
Reputation: 12537
ios
is in the std
-namespace. So either use use namespace std;
or extend from std::ios
instead of just ios
.
If you are using use namespace
use it only in your implementation-files like *.cpp
or *.cxx
, do not write use namespace ...
your header files - ever!.
And the same goes for streambuf
.
Upvotes: 5