Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7185461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:25:16+00:00 2026-05-28T18:25:16+00:00

I am working on a Windows VC++2008 program that does fileIO, and have hit

  • 0

I am working on a Windows VC++2008 program that does fileIO, and have hit an issue that is really weird. in my #include directives I have

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>

and then I have a method that actually does the fileIO, but when I try to open the file like this:

std::ofstream Output;
Output.open("Output/log.txt", ios::out);

my intelisense allows it, and even has correct auto completes, but my compiler throws an error of:

1>c:...\engine\gsp420maincore\gsp420maincore\messagequeue.cpp(141) : error C2653: 'ios' : is not a class or namespace name
1>c:...\engine\gsp420maincore\gsp420maincore\messagequeue.cpp(141) : error C2065: 'out' : undeclared identifier

when I read about the ofstream.open() it stated that whether the file to be opened is for input, output, or both should be specified, but ios should be automatically included by any other iostream #include directive, and this problem is not corrected when I insert the:

#include <ios> // directive

the compiler has no complaints when I remove the second argument, but I know that I should try, and specify just in case I want to go in and read from a file as well as write to it. did I do something wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:25:17+00:00Added an answer on May 28, 2026 at 6:25 pm

    It looks like you forgot to prefix it with std:: and you haven’t used using namespace std; (judging from the fact that you explicitly state the namespace for std::ofstream).

    Try changing it to std::ios::out.

    You should not need to #include <ios> manually.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a program in windows VC++ 2008. I started by
I'm working on a C# windows program with Visual Studio 2008. Usually, I work
I have modified a working Windows service that had always been starting beforehand. After
I am using Windows 7 and I have to run one program in that
Windows 2008 R2 server running PHP 5.3. I have URL Rewrite for IIS working
I have the following code. In windows server 2008, the program is correct and
I am working on a Windows VC++ 2008 project, and trying to use fileIO
I'm working on a project using Windows 2008, .NET 3.5 and WCF for some
I am working on a Windows Forms application in VS 2008, and I want
We are working on a Windows Mobile 6.5 application in Visual Studio 2008. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.