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 6820859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:28:32+00:00 2026-05-26T21:28:32+00:00

I am porting a solution from Visual C++ 8 (visual studio 2005) to 10

  • 0

I am porting a solution from Visual C++ 8 (visual studio 2005) to 10 (visual studio 2010), and I am getting a puzzling error for which I have found only sparse links on the web (for example this which refers to visual studio 2005, but there is no follow up so he must have fixed in some way).

The error is the following. In files which include the fstream header I get

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\fstream(111): error C2766: explicit specialization; 'bool std::_Ungetc<char>(const char &,_iobuf *)' has already been defined
1>          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\fstream(103) : see previous definition of '_Ungetc'

At first I supposed that there was some remaining reference to VC 8, so I started from scratch adding existing files to a new solution / project but I am getting the same error. Commenting out the include (and the relevant functionality) the project compiles and links.

This must be some kind of misconfiguration on my parts, since a minimal program like this

#include <fstream>
int main(){
    std::fstream stream;
    return 0;
}

is compiled without errors, so the header didn’t get somehow corrupt after installation.

I am unfortunately unable to reproduce a minimal working example, but I hope that something of this problem could ring a bell to someone. Do you have some suggestions of things that I could check?

  • 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-26T21:28:33+00:00Added an answer on May 26, 2026 at 9:28 pm

    The code around the lines mentioned in the error message defines several specializations for _Ungetc(), based on const char&, const signed char& and const unsigned char&, respectively.

    The error seems to indicate that your compiler is treating signed char as the same type as char, which should not happen.

    My best guess is that, somewhere in your code, before <fstream> is included, you have:

    #define char signed char
    

    Or, worse:

    #define signed
    

    In that case, removing the offending line will fix your problem. Note that char is signed by default anyway in MSVC, unless you pass it the /J option.

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

Sidebar

Related Questions

While porting an application from SQL 2005 to SQL Server Compact Edition, I found
Problem: I have a project which I'm porting from Solaris/Lex/Yacc to Linux/Flex/Bison + Autotools.
I have a C# solution composed of three projects in Visual Sudio 2010. One
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
I'm using Visual Studio 2010 Pro against Team Server 2010 and I had my
When trying to design a form in Visual Studio 2010: How do i tell
I'm looking for a solution for capturing audio from a user's microphone and posting
Im working on porting some old ALP user accounts to a new ASP.Net solution,
Porting code from 32bit to 64bit. Lots of places with int len = strlen(pstr);
While porting a desktop application to windows mobile I've reached the following error: Error

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.