Hi Shelarcy,

I'll try it on my Mac when I get home - could prove to be a
pre-processor difference between Visual Studio and GCC.

In the two cases given, I'd expect the BUILD_XRCGETCTRL_FN macro to
expand as follows:

Where _typ is Sizer
EWXWEXPORT(wxSizer*, wxXmlResource_GetSizer)(wxWindow* _win, wxString*
_str_id)
{
  return
  
reinterpret_cast<wxSizer*>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id));
}

Where _typ is BoxSizer
EWXWEXPORT(wxBoxSizer*, wxXmlResource_GetBoxSizer)(wxWindow* _win,
wxString* _str_id)
{
  return
  
reinterpret_cast<wxBoxSizer*>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id));
}

One thing to try: does adding a space after the paste tokens and before
the '*' tokens help? (i.e.

#define BUILD_XRCGETCTRL_FN(_typ)                                       
                     \
  EWXWEXPORT(wx##_typ## *, wxXmlResource_Get##_typ)(wxWindow* _win,
  wxString* _str_id)        \
  {                                                                     
                       \
  return reinterpret_cast<wx##_typ##
  *>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id))); \
  }

Alternatively, it's pretty easy to replace the auto-generated functions
with the manually created versions. If you find that the extra space
suggestion above does not work, I'll do a patch tomorrow with each of
the functions implemented in full.

Regards
Jeremy

On Thu, 23 Oct 2008 21:59:36 +0900, "shelarcy" <[EMAIL PROTECTED]>
said:
> Hi,
> 
> On Tue, 21 Oct 2008 19:59:52 +0900, Jeremy O'Donoghue
> <[EMAIL PROTECTED]> wrote:
> > Attached is a set of patches to enable XRC support in wxHaskell Darcs
> > head, along with a couple of samples (in the samples/test/XRCControls
> > directory) showing how to use the new functionality. They have only
> > really been tested on Windows, so it would help if people can look for
> > bugs on other platforms.
> 
> I got error when building wxc with xrc.patch on Mac OS X platform.
> 
> g++ -c wxc/src/eljrc.cpp -o dist/wxc/eljrc.o -MD -DwxcREFUSE_MEDIACTRL
> -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8
> -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ 
> -DwxUSE_STC=1 -DwxUSE_SVG=1 -fPIC -Iwxc/include
> wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a
> valid preprocessing token
> wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a
> valid preprocessing token
> wxc/src/eljrc.cpp:438:1: error: pasting "wxBoxSizer" and "*" does not
> give a valid preprocessing token
> (snip)
> make: *** [dist/wxc/eljrc.o] Error 1
> Build Failed.
> 
> It seems that BUILD_XRCGETCTRL_FN macro causes problem. Does anyone knows
> how to solve this problem?
> 
> My Mac's gcc version is 4.0.1.
> 
> shelarcy$ gcc -v
> Using built-in specs.
> Target: i686-apple-darwin9
> Configured with: /var/tmp/gcc/gcc-5484~1/src/configure --disable-checking
> -enable-werror --prefix=/usr --mandir=/share/man
> --enable-languages=c,objc,c++,obj-c++
> --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
> --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
> --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
> --host=i686-apple-darwin9 --target=i686-apple-darwin9
> Thread model: posix
> gcc version 4.0.1 (Apple Inc. build 5484)
> 
> 
> Best Regards,
> 
> -- 
> shelarcy <shelarcy    hotmail.co.jp>
> http://page.freett.com/shelarcy/
-- 
  Jeremy O'Donoghue
  [EMAIL PROTECTED]


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel

Reply via email to