Kenny Tilton wrote:
> /***
> *string.h - declarations for string manipulation functions
> *
> * Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
That is the wrong string.h. The problem is in the wxWidgets string.h,
not in the C library one.
I'm looking at it in their CVS tree. The relevant section is:
//
---------------------------------------------------------------------------
// string data prepended with some housekeeping info (used by wxString
class),
// is never used directly (but had to be put here to allow inlining)
//
---------------------------------------------------------------------------
struct WXDLLIMPEXP_BASE wxStringData
{
int nRefs; // reference count
size_t nDataLength, // actual string length
nAllocLength; // allocated memory size
// mimics declaration 'wxChar data[nAllocLength]'
wxChar* data() const { return (wxChar*)(this + 1); }
// empty string has a special ref count so it's never deleted
bool IsEmpty() const { return (nRefs == -1); }
bool IsShared() const { return (nRefs > 1); }
// lock/unlock
void Lock() { if ( !IsEmpty() ) nRefs++; }
// VC++ will refuse to inline Unlock but profiling shows that it is
wrong
#if defined(__VISUALC__) && (__VISUALC__ >= 1200)
__forceinline
#endif
// VC++ free must take place in same DLL as allocation when using non
dll
// run-time library (e.g. Multithreaded instead of Multithreaded DLL)
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
void Unlock() { if ( !IsEmpty() && --nRefs == 0) Free(); }
// we must not inline deallocation since allocation is not inlined
void Free();
#else
void Unlock() { if ( !IsEmpty() && --nRefs == 0) free(this); }
#endif
// if we had taken control over string memory (GetWriteBuf), it's
// intentionally put in invalid state
void Validate(bool b) { nRefs = (b ? 1 : 0); }
bool IsValid() const { return (nRefs != 0); }
};
Assuming this is the same file you have, what could be wrong? Perhaps
the WXDLLIMPEXP_BASE has the wrong value for the toolchain you are
using. This is supposed to expand to __dllimport or __dllexport under
the Microsoft compiler, which is a language extension that exists for
the sake of making and using C++ library DLL's. This will cause a
syntax error unless it's set to blank.
The errors suggest that the compiler has become confused and isn't
recognizing that IsValid() is being defined within a class! The nRefs
member appears undefined. That suggests that the compiler wasn't able
to grok the class declaration at all; and tried to recover by
continuing to read the source code at file scope.
Kaz Kylheku wrote:
> Kenny Tilton wrote:
>
>
>>/***
>>*string.h - declarations for string manipulation functions
>>*
>>* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
>
>
> That is the wrong string.h. The problem is in the wxWidgets string.h,
> not in the C library one.
Sorry, I had the C one on my mind after sorting out the strdup issue.
But it looks like you found the same wx/string.h I have. Thx for the effort.
>
> I'm looking at it in their CVS tree. The relevant section is:
>
> //
> ---------------------------------------------------------------------------
> // string data prepended with some housekeeping info (used by wxString
> class),
> // is never used directly (but had to be put here to allow inlining)
> //
> ---------------------------------------------------------------------------
>
> struct WXDLLIMPEXP_BASE wxStringData
> {
> int nRefs; // reference count
> size_t nDataLength, // actual string length
> nAllocLength; // allocated memory size
>
> // mimics declaration 'wxChar data[nAllocLength]'
> wxChar* data() const { return (wxChar*)(this + 1); }
>
> // empty string has a special ref count so it's never deleted
> bool IsEmpty() const { return (nRefs == -1); }
> bool IsShared() const { return (nRefs > 1); }
>
> // lock/unlock
> void Lock() { if ( !IsEmpty() ) nRefs++; }
>
> // VC++ will refuse to inline Unlock but profiling shows that it is
> wrong
> #if defined(__VISUALC__) && (__VISUALC__ >= 1200)
> __forceinline
> #endif
> // VC++ free must take place in same DLL as allocation when using non
> dll
> // run-time library (e.g. Multithreaded instead of Multithreaded DLL)
> #if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
> void Unlock() { if ( !IsEmpty() && --nRefs == 0) Free(); }
> // we must not inline deallocation since allocation is not inlined
> void Free();
> #else
> void Unlock() { if ( !IsEmpty() && --nRefs == 0) free(this); }
> #endif
>
> // if we had taken control over string memory (GetWriteBuf), it's
> // intentionally put in invalid state
> void Validate(bool b) { nRefs = (b ? 1 : 0); }
> bool IsValid() const { return (nRefs != 0); }
> };
>
>
>
>
> Assuming this is the same file you have, what could be wrong? Perhaps
> the WXDLLIMPEXP_BASE has the wrong value for the toolchain you are
> using. This is supposed to expand to __dllimport or __dllexport under
> the Microsoft compiler, which is a language extension that exists for
> the sake of making and using C++ library DLL's. This will cause a
> syntax error unless it's set to blank.
Good call. Messing with those defines cleared a couple of errors. But
the weird thing is I can tell gccxml to behave like msvc6 and get the
same errors, as if it were emulating that by default.
I'll slide over to gccxml and see what I can see.
Any VZN fans on a *nix want to try, well, just the gccxml command will
produce the errors:
gccxml -D__STDC__=0 -I\wxwidgets\include -I\wxwidgets\lib\vc_lib\msw
-fxml=vzn.xml vzntemp.cpp
where vzntemp.cpp is:
...........
#include "wx/wx.h"
const int __verrazano_binding = 1;
...........
Hmmm. Mebbe I should try a different setup.h than the one found in MSW.
<sigh> Good thing C++ is standard and portable like Common Lisp! <\sigh>
--
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
Kenny Tilton wrote:
> Thx for even wild guesses at this point.
try to reorder the include statements in your vzntemp.cpp. Take a look at
the Life example, which you've managed to compile.
--
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Frank Buss wrote:
> Kenny Tilton wrote:
>
> > Thx for even wild guesses at this point.
>
> try to reorder the include statements in your vzntemp.cpp. Take a look at
> the Life example, which you've managed to compile.
He compiled that with Microsoft VC++ 6. These errors are GNU C++.
:)
Kaz Kylheku wrote:
> Frank Buss wrote:
>
>>Kenny Tilton wrote:
>>
>>
>>>Thx for even wild guesses at this point.
>>
>>try to reorder the include statements in your vzntemp.cpp. Take a look at
>>the Life example, which you've managed to compile.
>
>
> He compiled that with Microsoft VC++ 6. These errors are GNU C++.
>
> :)
>
Thx for the other post, I will stare at that. As for this, I guess you
must be right since it /is/ called GCCXML. :) But I found I could make
it find things by placing them in the VC++/VC98/Include directory. Maybe
the GCCXML folks set things up to look there when they did the win32
port? Which reminds me, I should ask the GCCXML folks as well. Doh!
Thx.
ps. Life.cpp included just wx.h and then one more wx include.
--
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
Kenny Tilton wrote:
> Kaz Kylheku wrote:
> > Frank Buss wrote:
> >
> >>Kenny Tilton wrote:
> >>
> >>
> >>>Thx for even wild guesses at this point.
> >>
> >>try to reorder the include statements in your vzntemp.cpp. Take a look at
> >>the Life example, which you've managed to compile.
> >
> >
> > He compiled that with Microsoft VC++ 6. These errors are GNU C++.
> >
> > :)
> >
>
> Thx for the other post, I will stare at that. As for this, I guess you
> must be right since it /is/ called GCCXML. :)
WTF is that? Some GCC-based build system that reads VC++6 XML project
files?
From: Brian Downing
Subject: Re: Paging VC++ gurus, or "C++ errors are soooo scrutable" <sigh>
Date:
Message-ID: <NwS3f.486817$xm3.44586@attbi_s21>
In article <························@g44g2000cwa.googlegroups.com>,
Kaz Kylheku <········@gmail.com> wrote:
> WTF is that? Some GCC-based build system that reads VC++6 XML project
> files?
http://www.justfuckinggoogleit.com/search?q=GCCXML
It's GCC hacked up to produce XML output, so that you can use that XML
to interface with C++ without actually having to understand C++ syntax.
-bcd
--
*** Brian Downing <bdowning at lavos dot net>
Kaz Kylheku wrote:
>>Thx for the other post, I will stare at that. As for this, I guess you
>>must be right since it /is/ called GCCXML. :)
>
>
> WTF is that? Some GCC-based build system that reads VC++6 XML project
> files?
>
Some info here: http://common-lisp.net/project/fetter/
--
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
Kaz Kylheku wrote:
> He compiled that with Microsoft VC++ 6. These errors are GNU C++.
thanks, now I see why it might be more difficult than just compile another
file :-)
BTW: the GCCXML page says that it can emulate Visual C++ 7.1. Does this
mean it can parse all VC++ 7.1 features? The FAQ says no templates, but
does it support attributed ATL and all the other COM language extensions,
too? This may be useful when creating bindings for COM(+) and ActiveX
controls.
--
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de