Hello,
I have a problem compiling the wxScintilla component of CB's latest revision 5102 on Linux. I get the following message:
src/ScintillaWX.cpp: In member function `virtual void ScintillaWX::Paste()':
src/ScintillaWX.cpp:505: error: variable declaration is not allowed here
src/ScintillaWX.cpp:506: error: no matching function for call to `wxClipboard::
GetData(wxCustomDataObject (&)())'
/usr/include/wx-2.8/wx/gtk/clipbrd.h:42: error: candidates are: virtual bool
wxClipboard::GetData(wxDataObject&)
src/ScintillaWX.cpp:508: error: request for member `GetSize' in `selData',
which is of non-aggregate type `wxCustomDataObject ()()'
src/ScintillaWX.cpp:509: error: request for member `GetData' in `selData',
which is of non-aggregate type `wxCustomDataObject ()()'
src/ScintillaWX.cpp:511: error: request for member `GetDataSize' in `selData',
which is of non-aggregate type `wxCustomDataObject ()()'
From the svn log I see that ScintillaWx.cpp was modified at revision 5089 affecting lines 505 (where the error occurs) and 558 (where no error occurs). If I revert line 505 (but not 558) to its previous version (that is, setting selData's contructor argument to wxDF_PRIVATE again), it compiles fine. Furthermore, if I replace lines 505-511 by the following code fragment:
wxCustomDataObject *selData = new wxCustomDataObject (wxDataFormat(wxString(wxT("application/x-cbrectdata"))));
bool gotRectData = wxTheClipboard->GetData(*selData);
if (gotRectData && selData->GetSize()>1) {
const char* rectBuf = (const char*)selData->GetData();
rectangular = rectBuf[0] == (char)1;
len = selData->GetDataSize()-1;
(that is, imitating lines 558ff. by defining selData to be a pointer rather than an object; selData is deleted a few lines below), it compiles fine, too.
My system:
- SuSE Linux 9.1,
- wxGTK 2.8.7 ANSI,
- gcc 3.3.3.
I am aware of the fact that this equipment is fairly old, but sometimes it reveals lower-lying problems that would not appear otherwise. Since I presume that for those building CB on newer systems everthing works fine, I would really like to hear your opinions.
Perhaps I should also stress that I don't have this problem on Windows 2000, using wxMSW 2.8.7 ANSI and gcc 3.4.5 shipped with CB! Weird...
Regards,
Oliver