using wxMac as a static library.

John Labenski jlabenski at gmail.com
Wed Nov 1 21:41:40 PST 2006


On 11/1/06, Chris Perkins <cperkins at medialab.com> wrote:
>
>  I'm having the same problem that I reported yesterday.
>
>  Today I built wxMac 2.6.3 using the command line:  ../configure
> --disable-shared --enable-universal_binary
>
>  Next, I'm trying to incorporate the static libraries into my project.  I've
> set my include paths to the wxMac-2.6.3 folder.  The first file that does
> the basic  #include "wx/wx.h"  receives a number of errors when I attempt to
> compile it, the first of which is this:
>
>    __WIN32__ should be defined for Win32 and Win64, Win16 is not supported
>  from line 449 of  platform.h, included by defs.h included by wx.h
>
>  I'm looking at the block of #ifdef statements that precede that, and it
> looks to me like the compiler should have taken a different branch at line
> 381 which reads like so:
>  #elif defined(__WXMAC__) && defined(__APPLE__)
>
>  So I'm guessing that __WXMAC__ and/or __APPLE__  are not defined before
> reaching this branch point.
>
>  XCode says that neither is defined, but I suspect that's simply because it
> hasn't successfully compiled yet.
>
>
>  Where are these values expected to be defined?  Should I define them in my
> project? Or is it a clue to some other mistake I'm making?

include/wx/wx.h includes "wx/defs.h" which incudes "wx/platform.h"
which includes "wx/setup.h" which is NOT in wxWidgets/include/wx !

For builds using configure run $wx-config --cxxflags to get the proper
flags for your compiler. You need to do this to get them right for
different builds you may try in the future, don't waste  your time
trying to hard code them into your Makefile.

Please take a look at this Makefile and also the one in the
wxCode/components/wxstedit/src dir if you plan to build a library as
well. They use the wx-config script.

http://wxcode.cvs.sourceforge.net/wxcode/wxCode/components/wxstedit/samples/stedit/Makefile?view=markup

Regards,
    John Labenski




More information about the wx-users mailing list