We help IT Professionals succeed at work.

trouble with #define statements (driving me crazy)

chandas
chandas asked
on
Hi, I hope my question is a simple one. I have a main(...) file that includes a file <PIRequir.h> that itself includes a file called <Environ.h>

Inside <Environ.h> there are the following definitions

#ifndef PLATFORM
#ifdef WIN_ENV
#define PLATFORM "winpltfm.h"
#elif defined(unix) || defined(__unix)
 #define PLATFORM "UnixPlatform.h"
#else
#error You must define the PLATFORM macro
#endif
#endif

Currently no matter what I do, I still keep getting the "You must define the PLATFORM macro" error. My question is, where do I define it in my main(...) cpp file and how??

Regards

Senkwe

Comment
Watch Question

Commented:
In the preprocessor definitions you have to include "PLATFORM" like  /D "PLATFORM" . You won't get the error.

If are using VC++, Go to project settings->Select C/C++ tab and in the Preprocessor definitions add "PLATFORM"

Hope this solves your problem

Commented:
Try it out and tell me the feedback
Thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.