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

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2005
Posts: 45
Reputation: ilikerps is an unknown quantity at this point 
Solved Threads: 0
ilikerps ilikerps is offline Offline
Light Poster

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

 
0
  #1
Jan 25th, 2006
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:
  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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

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

 
0
  #2
Jan 25th, 2006
Try using the Multi Threading Debug switch /MTd and building the app.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 45
Reputation: ilikerps is an unknown quantity at this point 
Solved Threads: 0
ilikerps ilikerps is offline Offline
Light Poster

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

 
0
  #3
Jan 25th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC