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

Kenny Tilton ktilton at nyc.rr.com
Thu Oct 13 23:58:34 UTC 2005


It has been pointed out on c.l.l that I included the wrong string.h, 
that it is the wx string.h that is producing errors. I knew that <g>. 
But the strdup problem was solved by staring at the sdtdlib string.h and 
that left my brain in the wrong gear when I made the post. kt

Kenny Tilton wrote:

> 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.
>
>------------------------------------------------------------------------
>
>/***
>*string.h - declarations for string manipulation functions
>*
>*       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
>*
>*Purpose:
>*       This file contains the function declarations for the string
>*       manipulation functions.
>*       [ANSI/System V]
>*
>*       [Public]
>*
>****/
>
>#if     _MSC_VER > 1000
>#pragma once
>#endif
>
>#ifndef _INC_STRING
>#define _INC_STRING
>
>#if     !defined(_WIN32) && !defined(_MAC)
>#error ERROR: Only Mac or Win32 targets supported!
>#endif
>
>
>#ifdef  __cplusplus
>extern "C" {
>#endif
>
>
>
>/* Define _CRTIMP */
>
>#ifndef _CRTIMP
>#ifdef  _DLL
>#define _CRTIMP __declspec(dllimport)
>#else   /* ndef _DLL */
>#define _CRTIMP
>#endif  /* _DLL */
>#endif  /* _CRTIMP */
>
>/* Define __cdecl for non-Microsoft compilers */
>
>#if     ( !defined(_MSC_VER) && !defined(__cdecl) )
>#define __cdecl
>#endif
>
>/* Define _CRTAPI1 (for compatibility with the NT SDK) */
>
>#ifndef _CRTAPI1
>#if	_MSC_VER >= 800 && _M_IX86 >= 300
>#define _CRTAPI1 __cdecl
>#else
>#define _CRTAPI1
>#endif
>#endif
>
>
>#ifndef _SIZE_T_DEFINED
>typedef unsigned int size_t;
>#define _SIZE_T_DEFINED
>#endif
>
>
>#ifndef _MAC
>#ifndef _WCHAR_T_DEFINED
>typedef unsigned short wchar_t;
>#define _WCHAR_T_DEFINED
>#endif
>#endif  /* ndef _MAC */
>
>#ifndef _NLSCMP_DEFINED
>#define _NLSCMPERROR    2147483647  /* currently == INT_MAX */
>#define _NLSCMP_DEFINED
>#endif
>
>/* Define NULL pointer value */
>
>#ifndef NULL
>#ifdef __cplusplus
>#define NULL    0
>#else
>#define NULL    ((void *)0)
>#endif
>#endif
>
>
>/* Function prototypes */
>
>#ifdef  _M_MRX000
>_CRTIMP void *  __cdecl memcpy(void *, const void *, size_t);
>_CRTIMP int     __cdecl memcmp(const void *, const void *, size_t);
>_CRTIMP void *  __cdecl memset(void *, int, size_t);
>_CRTIMP char *  __cdecl _strset(char *, int);
>_CRTIMP char *  __cdecl strcpy(char *, const char *);
>_CRTIMP char *  __cdecl strcat(char *, const char *);
>_CRTIMP int     __cdecl strcmp(const char *, const char *);
>_CRTIMP size_t  __cdecl strlen(const char *);
>#else
>        void *  __cdecl memcpy(void *, const void *, size_t);
>        int     __cdecl memcmp(const void *, const void *, size_t);
>        void *  __cdecl memset(void *, int, size_t);
>        char *  __cdecl _strset(char *, int);
>        char *  __cdecl strcpy(char *, const char *);
>        char *  __cdecl strcat(char *, const char *);
>        int     __cdecl strcmp(const char *, const char *);
>        size_t  __cdecl strlen(const char *);
>#endif
>_CRTIMP void *  __cdecl _memccpy(void *, const void *, int, unsigned int);
>_CRTIMP void *  __cdecl memchr(const void *, int, size_t);
>_CRTIMP int     __cdecl _memicmp(const void *, const void *, unsigned int);
>
>#ifdef  _M_ALPHA
>        /* memmove is available as an intrinsic in the Alpha compiler */
>        void *  __cdecl memmove(void *, const void *, size_t);
>#else
>_CRTIMP void *  __cdecl memmove(void *, const void *, size_t);
>#endif
>
>
>_CRTIMP char *  __cdecl strchr(const char *, int);
>_CRTIMP int     __cdecl _strcmpi(const char *, const char *);
>_CRTIMP int     __cdecl _stricmp(const char *, const char *);
>_CRTIMP int     __cdecl strcoll(const char *, const char *);
>_CRTIMP int     __cdecl _stricoll(const char *, const char *);
>_CRTIMP int     __cdecl _strncoll(const char *, const char *, size_t);
>_CRTIMP int     __cdecl _strnicoll(const char *, const char *, size_t);
>_CRTIMP size_t  __cdecl strcspn(const char *, const char *);
>_CRTIMP char *  __cdecl _strdup(const char *);
>_CRTIMP char *  __cdecl _strerror(const char *);
>_CRTIMP char *  __cdecl strerror(int);
>_CRTIMP char *  __cdecl _strlwr(char *);
>_CRTIMP char *  __cdecl strncat(char *, const char *, size_t);
>_CRTIMP int     __cdecl strncmp(const char *, const char *, size_t);
>_CRTIMP int     __cdecl _strnicmp(const char *, const char *, size_t);
>_CRTIMP char *  __cdecl strncpy(char *, const char *, size_t);
>_CRTIMP char *  __cdecl _strnset(char *, int, size_t);
>_CRTIMP char *  __cdecl strpbrk(const char *, const char *);
>_CRTIMP char *  __cdecl strrchr(const char *, int);
>_CRTIMP char *  __cdecl _strrev(char *);
>_CRTIMP size_t  __cdecl strspn(const char *, const char *);
>_CRTIMP char *  __cdecl strstr(const char *, const char *);
>_CRTIMP char *  __cdecl strtok(char *, const char *);
>_CRTIMP char *  __cdecl _strupr(char *);
>_CRTIMP size_t  __cdecl strxfrm (char *, const char *, size_t);
>
>#ifdef  _MAC
>unsigned char * __cdecl _c2pstr(char *);
>char * __cdecl _p2cstr(unsigned char *);
>
>#if     !__STDC__
>__inline unsigned char * __cdecl c2pstr(char *sz) { return _c2pstr(sz);};
>__inline char * __cdecl p2cstr(unsigned char *sz) { return _p2cstr(sz);};
>#endif
>#endif
>
>#if     !__STDC__
>
>/* prototypes for oldnames.lib functions */
>_CRTIMP void * __cdecl memccpy(void *, const void *, int, unsigned int);
>_CRTIMP int __cdecl memicmp(const void *, const void *, unsigned int);
>_CRTIMP int __cdecl strcmpi(const char *, const char *);
>_CRTIMP int __cdecl stricmp(const char *, const char *);
>_CRTIMP char * __cdecl strdup(const char *);
>_CRTIMP char * __cdecl strlwr(char *);
>_CRTIMP int __cdecl strnicmp(const char *, const char *, size_t);
>_CRTIMP char * __cdecl strnset(char *, int, size_t);
>_CRTIMP char * __cdecl strrev(char *);
>        char * __cdecl strset(char *, int);
>_CRTIMP char * __cdecl strupr(char *);
>
>#endif  /* !__STDC__ */
>
>
>#ifndef _MAC
>#ifndef _WSTRING_DEFINED
>
>/* wide function prototypes, also declared in wchar.h  */
>
>_CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *);
>_CRTIMP wchar_t * __cdecl wcschr(const wchar_t *, wchar_t);
>_CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *);
>_CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *);
>_CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *);
>_CRTIMP size_t __cdecl wcslen(const wchar_t *);
>_CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t);
>_CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t);
>_CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t);
>_CRTIMP wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *);
>_CRTIMP wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t);
>_CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *);
>_CRTIMP wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *);
>_CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *);
>
>_CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *);
>_CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *);
>_CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
>_CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t);
>_CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *);
>_CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t);
>
>_CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *);
>_CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *);
>_CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t);
>_CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *);
>_CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *);
>_CRTIMP int __cdecl _wcsncoll(const wchar_t *, const wchar_t *, size_t);
>_CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t);
>
>#if     !__STDC__
>
>/* old names */
>#define wcswcs wcsstr
>
>/* prototypes for oldnames.lib functions */
>_CRTIMP wchar_t * __cdecl wcsdup(const wchar_t *);
>_CRTIMP int __cdecl wcsicmp(const wchar_t *, const wchar_t *);
>_CRTIMP int __cdecl wcsnicmp(const wchar_t *, const wchar_t *, size_t);
>_CRTIMP wchar_t * __cdecl wcsnset(wchar_t *, wchar_t, size_t);
>_CRTIMP wchar_t * __cdecl wcsrev(wchar_t *);
>_CRTIMP wchar_t * __cdecl wcsset(wchar_t *, wchar_t);
>_CRTIMP wchar_t * __cdecl wcslwr(wchar_t *);
>_CRTIMP wchar_t * __cdecl wcsupr(wchar_t *);
>_CRTIMP int __cdecl wcsicoll(const wchar_t *, const wchar_t *);
>
>#endif  /* !__STDC__ */
>
>#define _WSTRING_DEFINED
>#endif
>
>#endif  /* ndef _MAC */
>
>#ifdef  __cplusplus
>}
>#endif
>
>#endif  /* _INC_STRING */
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>fetter-devel mailing list
>fetter-devel at common-lisp.net
>http://common-lisp.net/cgi-bin/mailman/listinfo/fetter-devel
>  
>

-- 
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






More information about the fetter-devel mailing list