fatal error C1189

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2008
Posts: 1
Reputation: sharareh26zaman is an unknown quantity at this point 
Solved Threads: 0
sharareh26zaman sharareh26zaman is offline Offline
Newbie Poster

fatal error C1189

 
0
  #1
Oct 16th, 2008
hello dear friends
I have written a simple file merger and the code has been shown as bellow but I get an error that I do not how to solve it please guide me .
Attached Files
File Type: cpp merge5.cpp (1.3 KB, 4 views)
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,495
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 123
Sponsor
William Hemsworth William Hemsworth is online now Online
Nearly a Posting Virtuoso

Re: fatal error C1189

 
0
  #2
Oct 16th, 2008
Code this small can easily be embedded into your post, so in future, do it
  1. #define _AFXDLL
  2.  
  3. #include <fstream>
  4. #include <string>
  5. #include <Cstringt.h>
  6. #include <iostream>
  7. #include <direct.h>
  8. #include <afxv_w32.h>
  9.  
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14. string line1, line2 ;
  15. string end_str ;
  16. CFileFind finder;
  17. bool finding = finder.FindFile ();
  18. bool firstFile=1;
  19. bool condition;
  20. //-------------------------------------------------------------
  21. end_str = "<ENDFILE;" ;
  22. condition= 0;
  23. while (finding)
  24. {
  25. finding = finder.FindNextFile();
  26. Cstring title = finder.GetFileName();
  27. ifstream fin (title);
  28. if(!fin)
  29. {
  30. cout<< "cannot open input file \n";
  31. return 1;
  32. }
  33. ofstream fout ("merge.cf");
  34. if (!fout)
  35. {
  36. cout<< "cannot open output file .\n";
  37. return 1;
  38. }
  39. //..............................................................
  40. if(firstFile)
  41. {
  42. while (!fin.eof())
  43. {
  44. getline (fin,line1);
  45. getline (fin,line2);
  46. if (end_str==line2)
  47. condition=1;
  48. else
  49. condition=0;
  50. if(!condition)
  51. fout<<line1<<'\n';
  52. else
  53. fout<<line1;
  54. }
  55. firstFile=0;
  56. }
  57. else
  58. {
  59. getline (fin,line1);
  60. fout<<'\n';
  61. while (!fin.eof())
  62. {
  63. getline (fin,line1);
  64. fout<<line1<<'\n';
  65. }
  66. }
  67. fout.close();
  68. }
  69. finder.Close ();
  70. return 0;
  71. }
Last edited by William Hemsworth; Oct 16th, 2008 at 11:58 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: fatal error C1189

 
0
  #3
Oct 16th, 2008
http://msdn.microsoft.com/en-us/libr...e0(VS.80).aspx
My guess is you remove #define _AFXDLL since you're creating an executable (it has a main) and not a DLL.

But if you click the link, and then look at the real cause of the #error, and tell us that as well, we might get further.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 884 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC