I am trying to include 2 platform-specific stdafx.h files in my .cpp file, but the compiler is unhappy when I try to #ifdef it.
#ifdef _WIN32
#include "stdafx.h"
#elif _MAC
#include "MAC/stdafx.h"
#endif
You may wonder why I am using stdafx.h in the Mac code, but that is not important at the moment :).
When I try to compile the code on Windows, I receive: Fatal Error C1018. I tried enclosing other header files with #ifdef in the same file, and the compiler was happy. Therefore, it looks like Windows doesn't like stdafx.h to be #ifdef-ed, or that Windows only allows #include stdafx.h to be the first line in the file.
So my question is, why?
Kat
Such symptoms may be due to an underlying condition, like mild cognitive impairment, or a mood disorder, like depression and anxiety. Declining focus also could result from lifestyle issues that should be addressed, such as stress, fatigue, poor sleep, dehydration, an unhealthy diet, or sedentary behavior.
attention deficit hyperactivity disorder (ADHD)
Lack of sleep. It's tough to pay attention when you're tired. That's because your brain cells recharge and recover when you're asleep. They don't work as well when you don't get enough rest. Research shows that skipping even one night of sleep makes it harder to focus and block out distractions.
Attention-deficit/hyperactivity disorder (ADHD)
When the compiler includes a pre-compiled header, it basically "forgets" anything that came before the header. Thus your #elif isn't matched to a #if anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With