I'm usig vS 2005 c++ to create a basic 3D engine, But I'm hanged just begin with somtehing I believe stupid. I'd Like to have a Log class to report all the errors but I don't know why there's an error I can't understand
Here's the error:
Error 1 error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>' D:\Archivos de programa\Microsoft Visual Studio 8\VC\include\fstream 802
Here's the code:
<Log.cpp>
#include "Log.h"
Log::Log(void)
{
}
Log::Log(string filename)
{
_filename = filename;
}
Log::~Log(void)
{
}
void Log::write(string text)
{
logFile.open (_filename.c_str());
logFile << text;
logFile.close();
}
void Log::writeLine(string text)
{
logFile.open (_filename.c_str());
logFile << text << "\n";
logFile.close();
}
<Log.h>
#ifndef INC_LOG_INC
#define INC_LOG_INC
#pragma once
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Log
{
public:
string _filename;
private:
ofstream logFile;
public:
Log(void);
Log(string _filename);
~Log(void);
void write(string text);
void writeLine(string text);
};
#endif
I called the method with Log logFile("filename");
Another question is, If I want to send this errors to the output window of VS how can I do it?
Sorry for my bad writing And Thank you all.











