954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

fstream.h + winsock2.h doesn't work?

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 simplyinclude 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.

ilikerps
Light Poster
45 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

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

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 

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.

ilikerps
Light Poster
45 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You