[fetter-devel] Paging VC++ gurus, or "C++ errors are soooo scrutable" <sigh>

Kenny Tilton ktilton at nyc.rr.com
Thu Oct 13 22:18:23 UTC 2005


Recent discussion of wxCL had me wondering if Verrazano (vzn) could 
swallow wxWidgets. Here is the current state of the binding definition:

(defbinding "wxWidgets-library"
    (nicknames "wx")
  (flags "-D__STDC__=0 -D__VISUALC__=1 -DWIN32 -D_DEBUG -D_CONSOLE 
-D_MBCS -I\\wxWidgets\\include -I\\wxWidgets\\lib\\vc_dll\\msw")
  (include "wx/wx.h"))

[note to vzn cognoscenti: no, this will not produce any bindings until 
we get the new vzn which will have the option of binding recursively, 
but it fails the same way as when all the wx headers are listed so it 
will serve until I get a clean run.]

[Aside: Bug report, probably obsolete: that long flags line causes an 
error from gccxml if broken across multiple lines. I say "obsolete" 
because the next release of vzn will make defbinding into a macro and 
the Lisp reader will be doing the parsing. Anywho...]

Now wxWidgets is fine. I can build in VC++6 a wx demo such as Life 
without a problem. I have even created a VC++6 project for the 
intermediate vzntemp.cpp and /that/ compiles OK. What I learned along 
the way is to take the VC++ project options which produce a successful 
build (in this case:)

/nologo /MLd /W3 /Gm /GX /ZI /Od /I "\wxwidgets\include" /I 
"\wxwidgets\lib\vc_dll\msw" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D 
"_MBCS" /FR"Debug/" /Fp"Debug/vzntemp.pch" /YX /Fo"Debug/" /Fd"Debug/" 
/FD /GZ /c

...and do my damnedest to recreate that in the flags option. This got me 
as far as a bunch of STRDUP undefined errors, which should bring no 
small delight to Frank <g>, but a little digging in stdio.h suggested to 
me the additional define of __STDC__=0 would fix things, and it did 
nicely. (Ha! <g>) Apparently strdup is deprecated with extreme 
prejudice. Anyway, now I am down to this:

In file included from /wxWidgets/include/wx/memory.h:20,
                 from /wxWidgets/include/wx/object.h:25,
                 from /wxWidgets/include/wx/wx.h:16,
                 from C:/program files/acl70/vzntemp.cpp:1:
/wxWidgets/include/wx/string.h:237: error: syntax error before `void'
/wxWidgets/include/wx/string.h:242: error: semicolon missing after 
declaration
   of `wxStringData'
/wxWidgets/include/wx/string.h:242: error: ISO C++ forbids defining types
   within return type
/wxWidgets/include/wx/string.h:242: error: two or more data types in
   declaration of `Validate'
/wxWidgets/include/wx/string.h:242: error: semicolon missing after 
declaration
   of `struct wxStringData'
/wxWidgets/include/wx/string.h: In function `int Validate(bool)':
/wxWidgets/include/wx/string.h:242: error: `nRefs' undeclared (first use 
this
   function)
/wxWidgets/include/wx/string.h:242: error: (Each undeclared identifier is
   reported only once for each function it appears in.)
/wxWidgets/include/wx/string.h: At global scope:
/wxWidgets/include/wx/string.h:243: error: non-member function `bool 
IsValid()'
   cannot have `const' method qualifier
/wxWidgets/include/wx/string.h:244: error: syntax error before `}' token
/wxWidgets/include/wx/string.h: In member function `void 
wxStringBase::Reinit()
   ':
/wxWidgets/include/wx/string.h:268: error: `Unlock' undeclared (first 
use this
   function)
/wxWidgets/include/wx/string.h: In copy constructor `
   wxStringBase::wxStringBase(const wxStringBase&)':
/wxWidgets/include/wx/string.h:308: error: `IsValid' undeclared (first 
use this
   function)
/wxWidgets/include/wx/string.h: In constructor `
   wxStringBase::wxStringBase(const wxStringBase&, unsigned int, 
unsigned int)
   ':
/wxWidgets/include/wx/string.h:333: error: `IsValid' undeclared (first 
use this
   function)
/wxWidgets/include/wx/string.h: In destructor 
`wxStringBase::~wxStringBase()':
/wxWidgets/include/wx/string.h:351: error: `Unlock' undeclared (first 
use this
   function)
/wxWidgets/include/wx/string.h: In member function `wxStringBase&
   wxStringBase::insert(unsigned int, const wxStringBase&)':
/wxWidgets/include/wx/string.h:443: error: `IsValid' undeclared (first 
use this
   function)
/wxWidgets/include/wx/string.h: In member function `wxStringBase&
   wxStringBase::insert(unsigned int, const wxStringBase&, unsigned int,
   unsigned int)':
/wxWidgets/include/wx/string.h:449: error: `IsValid' undeclared (first 
use this
   function)
/wxWidgets/include/wx/string.h: In member function `wxString&
   wxString::operator<<(const wxString&)':
/wxWidgets/include/wx/string.h:885: error: `IsValid' undeclared (first 
use this
   function)
In file included from /wxWidgets/include/wx/window.h:1352,
                 from /wxWidgets/include/wx/app.h:23,
                 from /wxWidgets/include/wx/wx.h:24,
                 from C:/program files/acl70/vzntemp.cpp:1:
/wxWidgets/include/wx/msw/window.h: At global scope:
/wxWidgets/include/wx/msw/window.h:54: error: class `wxWindow' is 
implicitly
   friends with itself

Looking at string.h, well, "syntax error before void"? <sigh>

Any idea what flag I must be missing to get that? Two things I will be 
exploring:

-- Is this a vzn known limitation in any way? ie, something on the to-do 
list?
-- Do any of those project options translate to a define I have to add, 
a la __STDC__=0? I worked that one out by reading string.h, but "error 
before void"  is not quite as helpful as "strdup undefined".

Thx for even wild guesses at this point.

-- 
Kenny

Why Lisp? http://wiki.alu.org/RtL_Highlight_Film

"I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it."
    Elwood P. Dowd, "Harvey", 1950

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: STRING.H
URL: <https://mailman.common-lisp.net/pipermail/fetter-devel/attachments/20051013/533cb121/attachment.ksh>


More information about the fetter-devel mailing list