It Just Sucks!
-
Facts: 0) Using EVC3 on Win2K Pro 1) I have the following project folder structure:
PocketApp
|
+-----CommonSourceCode- The app uses MFC, and contains the standard "stdafx.h" file. 3) The "CommonSourceCode" folder contains code that can be used by other apps, but right now, no sharing of code is going on. 4) I added some code to the "CommonSourceCode" folder that includes the following lines at the top of the CPP file:
#ifdef POCKET_APP
#include "stdafx.h"
#else
#include "winbase.h"
#endif- The compiler complains that the "#else" is unexpected. So I tried this:
#ifdef POCKET_APP
#include "stdafx.h"
#endif
#ifndef POCKET_APP
#include "winbase.h"
#endif- The compiler now complains that the #endif is unexpected. 7) I also tried making the "stdafx.h" a macro itself, and still the same errors. 8) The only way I can #include stdafx.h is by NOT using macros to determine if the inclusion is the desired one. 9) This sucks. Microsoft sucks. Windows CE sucks. EVC3 sucks. I can't upgrade to EVC4 (and even if I could, I doubt they would have fixed this problem). Am I missing something here? ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 "You won't like me when I'm angry..." - Dr. Bruce Banner Please review the Legal Disclaimer in my bio. ------- signature ends
-
Facts: 0) Using EVC3 on Win2K Pro 1) I have the following project folder structure:
PocketApp
|
+-----CommonSourceCode- The app uses MFC, and contains the standard "stdafx.h" file. 3) The "CommonSourceCode" folder contains code that can be used by other apps, but right now, no sharing of code is going on. 4) I added some code to the "CommonSourceCode" folder that includes the following lines at the top of the CPP file:
#ifdef POCKET_APP
#include "stdafx.h"
#else
#include "winbase.h"
#endif- The compiler complains that the "#else" is unexpected. So I tried this:
#ifdef POCKET_APP
#include "stdafx.h"
#endif
#ifndef POCKET_APP
#include "winbase.h"
#endif- The compiler now complains that the #endif is unexpected. 7) I also tried making the "stdafx.h" a macro itself, and still the same errors. 8) The only way I can #include stdafx.h is by NOT using macros to determine if the inclusion is the desired one. 9) This sucks. Microsoft sucks. Windows CE sucks. EVC3 sucks. I can't upgrade to EVC4 (and even if I could, I doubt they would have fixed this problem). Am I missing something here? ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 "You won't like me when I'm angry..." - Dr. Bruce Banner Please review the Legal Disclaimer in my bio. ------- signature ends
Try this: Open the project settings (Alt-F7), go to the C++ tab, select the "Precompiled Headers" category and select "Not using precompiled headers". If your code now compiles correctly, you are suffering from stdafx / precompiled headers blues (yeah, I know it sucks). What can you do to retain the precompiled header functionality? Try to remove all nonessential stuff out of stdafx.h and copy it into another include file. Leave there only microsoft-generated stuff. Always include stdafx.h unconditionally. Well, I hope I made some sense... Regards, João Paulo
-
Facts: 0) Using EVC3 on Win2K Pro 1) I have the following project folder structure:
PocketApp
|
+-----CommonSourceCode- The app uses MFC, and contains the standard "stdafx.h" file. 3) The "CommonSourceCode" folder contains code that can be used by other apps, but right now, no sharing of code is going on. 4) I added some code to the "CommonSourceCode" folder that includes the following lines at the top of the CPP file:
#ifdef POCKET_APP
#include "stdafx.h"
#else
#include "winbase.h"
#endif- The compiler complains that the "#else" is unexpected. So I tried this:
#ifdef POCKET_APP
#include "stdafx.h"
#endif
#ifndef POCKET_APP
#include "winbase.h"
#endif- The compiler now complains that the #endif is unexpected. 7) I also tried making the "stdafx.h" a macro itself, and still the same errors. 8) The only way I can #include stdafx.h is by NOT using macros to determine if the inclusion is the desired one. 9) This sucks. Microsoft sucks. Windows CE sucks. EVC3 sucks. I can't upgrade to EVC4 (and even if I could, I doubt they would have fixed this problem). Am I missing something here? ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 "You won't like me when I'm angry..." - Dr. Bruce Banner Please review the Legal Disclaimer in my bio. ------- signature ends
John Simmons / outlaw programmer wrote: Am I missing something here? My guess is that something gets screwed with the pre-compiled header directive. Turn off precompiled headers for your \CommonSourceCode files in your mfc project. That should atleast make it compile. John Simmons / outlaw programmer wrote: Microsoft sucks. Windows CE sucks. EVC3 sucks I know the feeling. I get to this state about once a month. ;) Jonas “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002