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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:24:03+00:00 2026-05-26T18:24:03+00:00

been banging my head on the table over this all night. I’m simply trying

  • 0

been banging my head on the table over this all night.

I’m simply trying to declare an ifstream object like so….

ifstream inputStream;

I’m getting this error:

Error 5 error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >::operator*(void)const " (??D?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDXZ)    C:\Users\Julz\Desktop\My Dropbox\3rdYear\2ndSemester\Games Prog\Game\DemocracyInvaders\Score.obj    DemocracyInvaders

I can declare it as a pointer like so…

ifstream *inputStream;

but that just goes on to headaches when I try to read in file data and I figure I should work out why the basic declaration isn’t working before trying some hacked out fix.

I’m using SDL and have the following includes in a header a few files down…

#ifndef SDL_GRAPHICS_H //just a class I'm using to initialise my SDL stuff
#define SDL_GRAPHICS_H

#include <stdio.h>
#include <iostream>
#include <vector>
#include <fstream>
#include "SDL.h" 
#include "SDL_ttf.h"

I’ve tried swapping the SDL includes above the C++ stuff and all sorts of variations, nothing.
My header includes are all in the right order and I’m thinking that if there was a problem with includes I couldn’t declare the ifstream as a pointer?

oh, I’ve tried using fstream and even just declaring ofstream, all the same error.
also, it doesn’t matter what class (source or header) I try it in, always the same. Even tried declaring it in my driver (main) file with the includes directly in it, no dice…
Totally lost here!

  • 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-26T18:24:03+00:00Added an answer on May 26, 2026 at 6:24 pm

    It looks like you are failing to link the C runtime into your application. When declared as a non-pointer you bring in at least the constructor of the ifstream class into your application. It appears that the constructor calls a function which is a part of the C-runtime and hence you end up with a linking error.

    • http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been banging my head against the wall all night trying to figure out
I've been banging my head on the wall over this issue for a couple
Been banging my head against this problem all morning. I have setup a connection
I've been banging my head over this issue for about 5 hours now, I'm
I've been banging my head against the wall for hours trying to figure this
I have been banging my head over this one for quite a while now
Been banging my head against the wall on this one all day and am
I've been banging my head against a wall trying make this work for a
I've been banging my head over this for hours now... and can't seem to
Been banging my head against this all morning. Basically, I have a listbox, and

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.