Re: [Dev-C++] wxWindows include files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Shaddow <Sh...@ti...> - 2001-03-24 02:14:33
|
ma...@ju... wrote: > Here's what the compiler says: > 215 c:\dev-c_~1\include\wx\defs.h > #error "No Target! Use > -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS_ > _]" > 7 c:\mydocu~1\cpp\firstm~1.cpp > C:\DEV-C_~1\INCLUDE\wx\setup.h:15: #error No __WXxxx__ define set! Please > define one of > __WXBASE__,__WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__ > WXSTUBS > I admit I am a newbie, basically clueless as to how to define targets or > build makefiles. So any help would be greatly appreciated on this. > For a wxWindows program to compile properly, you need to have defined one of a handful of pre-processor variables. wxWindows is designed to support a variety of platforms and as is often the case for cross platform code, things that work on one system won't work on another. These situations are handled with conditional compilation. Something like: //- Do generic code here ... #ifdef __WXMOTIF__ //- Do Motif specific code here ... #elseif __WXMSW__ //- Do Microsoft specific code here. ... #endif //- Do more generic code here ... The error you're getting is simply telling you that you *have* to have defined one of the pre-processor variables listed. The easiest way to do this is with a compiler command line directive of "-D<variable name>". In Dev-C++ you can do this by opening your project, choose "Project Options" from the "Project" menu and adding "-D__WXMSW__" (without the quotes) to the end of the text in the "Extra compiler options" field. Brian |