Hello, I am working on a server program that deals with opening files, or at least that is all that is relevant for this post. I am using VC++.
I use multithreading so that it can be multi-client, of course, but when I try to use this line:

infile.open(filename, ios::in);

(assume "ifstream infile" and "string filename" defined)
This causes the error "unresolved external symbol __CrtDbgReport". I am fairly sure this has something to do with the multithreading aspect of the program because it only started appearing when I added the threads.

The same exact error comes up when I try to simply include iostream.h but I didn't think of it much at the time because I learned that printf() worked. However, unless there is a fileopenf(), I think this an impasse.

If there is a way to fix this fstream problem, maybe it would also fix the iostream problem.

Recommended Answers

All 2 Replies

Try using the Multi Threading Debug switch /MTd and building the app.

Gah! Why does that work and why are my problems always so simple and stupid?
No, that was a rhetorical question. Thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.