944,147 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 1704
  • C++ RSS
Jan 25th, 2006
0

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

Expand Post »
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:
C++ Syntax (Toggle Plain Text)
  1. 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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ilikerps is offline Offline
45 posts
since Dec 2005
Jan 25th, 2006
0

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

Try using the Multi Threading Debug switch /MTd and building the app.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Jan 25th, 2006
0

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

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.
Reputation Points: 10
Solved Threads: 0
Light Poster
ilikerps is offline Offline
45 posts
since Dec 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: make file
Next Thread in C++ Forum Timeline: Compile errors [help] [ log ]





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC