User forums > Using Code::Blocks
Build error in SVN Rev. 1447 ( wxSmith )
TheTuxKeeper:
When compiling the current svn rev. 1447, I get this error in the wxSmith directory:
--- Code: --- g++ -DHAVE_CONFIG_H -I. -I../../../../../../src/plugins/contrib/wxSmith -I../../../../src/sdk -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -I../../../../../../src/sdk -I../../../../../../src/sdk/wxscintilla/include -I../../../../../../src/plugins/contrib/wxSmith/propgrid/include -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -Os -march=athlon -O2 -ffast-math -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -MT wxsproject.lo -MD -MP -MF .deps/wxsproject.Tpo -c ../../../../../../src/plugins/contrib/wxSmith/./wxsproject.cpp -fPIC -DPIC -o .libs/wxsproject.o
../../../../../../src/plugins/contrib/wxSmith/./wxsproject.cpp: In member function 'virtual bool wxsProject::LoadFromXml(TiXmlNode*)':
../../../../../../src/plugins/contrib/wxSmith/./wxsproject.cpp:221: error: ambiguous overload for 'operator=' in '((wxsProject*)this)->wxsProject::AppFile = Elem-> TiXmlElement::Attribute(((const char*)"app_src_file"))'
/usr/include/wx-2.6/wx/string.h:626: note: candidates are: wxString& wxString::operator=(int) <near match>
/usr/include/wx-2.6/wx/string.h:845: note: wxString& wxString::operator=(wxChar) <near match>
/usr/include/wx-2.6/wx/string.h:859: note: wxString& wxString::operator=(const wxWCharBuffer&) <near match>
/usr/include/wx-2.6/wx/string.h:610: note: wxString& wxString::operator=(const wxString&) <near match>
../../../../../../src/plugins/contrib/wxSmith/./wxsproject.cpp:222: error: ambiguous overload for 'operator=' in '((wxsProject*)this)->wxsProject::MainResource = Elem-> TiXmlElement::Attribute(((const char*)"main_resource"))'
/usr/include/wx-2.6/wx/string.h:626: note: candidates are: wxString& wxString::operator=(int) <near match>
/usr/include/wx-2.6/wx/string.h:845: note: wxString& wxString::operator=(wxChar) <near match>
/usr/include/wx-2.6/wx/string.h:859: note: wxString& wxString::operator=(const wxWCharBuffer&) <near match>
/usr/include/wx-2.6/wx/string.h:610: note: wxString& wxString::operator=(const wxString&) <near match>
../../../../../../src/plugins/contrib/wxSmith/./wxsproject.cpp:223: error: conversion from 'const char*' to 'wxString' is ambiguous
/usr/include/wx-2.6/wx/string.h:642: note: candidates are: wxString::wxString(wxChar, size_t) <near match>
/usr/include/wx-2.6/wx/string.h:632: note: wxString::wxString(int) <near match>
--- End code ---
I build it with OpenSuse 10.0 wxGTK 2.6.1.
The rest compiles without any errors.
Daniel
Urxae:
Looks like wxSmith has some Unicode macros missing and your wx is compiled with unicode on...
If you go to the indicated lines and apply either _() (for text that should be translated) or _T() (for other text) to string literals found it should go away. (At least for the first two, the third one depends on what exactly is happening there; it doesn't list a string literal in the error like the first two)
TheTuxKeeper:
These are the lines. Where to put the _() or _T() around?
--- Code: --- // Loading configuration stuff
Elem = MainNode->FirstChildElement(XML_CONFIG_STR);
if ( Elem )
{
AppFile = wxString ( Elem->Attribute(XML_APPFILE_STR), wxConvUTF8 ); // <-- line 221
MainResource = wxString( Elem->Attribute(XML_MAINRES_STR), wxConvUTF8 ); // <-- line 222
wxString InitAllMode = wxString( Elem->Attribute(XML_INITALL_STR),wxConvUTF8); // <-- line 223
if ( InitAllMode == _T("never") )
{
CallInitAll = false;
CallInitAllNecessary = false;
}
else if ( InitAllMode == _T("always") )
{
CallInitAll = true;
CallInitAllNecessary = false;
}
else
{
CallInitAll = true;
CallInitAllNecessary = true;
}
}
--- End code ---
cyberkoa:
I try to compile on wxmsw unicode but no problem , I suspect is the following code that on the wxsprojects.cpp
--- Code: ---#define XML_DIALOG_STR "dialog"
#define XML_FRAME_STR "frame"
#define XML_PANEL_STR "panel"
#define XML_FNAME_STR "wxs_file"
#define XML_CNAME_STR "class"
#define XML_SFILE_STR "src_file"
#define XML_HFILE_STR "header_file"
#define XML_XRCFILE_STR "xrc_file"
#define XML_EDITMODE_STR "edit_mode"
#define XML_CONFIG_STR "configuration"
#define XML_APPFILE_STR "app_src_file"
#define XML_MAINRES_STR "main_resource"
#define XML_INITALL_STR "init_all_handlers"
#define XML_AUTOLOAD_STR "load_resource"
--- End code ---
can you try to change those #define to the following
--- Code: ---#define XML_DIALOG_STR _T("dialog")
#define XML_FRAME_STR _T("frame")
#define XML_PANEL_STR _T("panel")
#define XML_FNAME_STR _T("wxs_file")
:
:
etc
--- End code ---
and try again . Let us know whether success or not , thx
TheTuxKeeper:
I changed the #define lines, but the errors are the same :(
--- Code: ---#define XML_DIALOG_STR _T("dialog")
#define XML_FRAME_STR _T("frame")
#define XML_PANEL_STR _T("panel")
#define XML_FNAME_STR _T("wxs_file")
#define XML_CNAME_STR _T("class")
#define XML_SFILE_STR _T("src_file")
#define XML_HFILE_STR _T("header_file")
#define XML_XRCFILE_STR _T("xrc_file")
#define XML_EDITMODE_STR _T("edit_mode")
#define XML_CONFIG_STR _T("configuration")
#define XML_APPFILE_STR _T("app_src_file")
#define XML_MAINRES_STR _T("main_resource")
#define XML_INITALL_STR _T("init_all_handlers")
#define XML_AUTOLOAD_STR _T("load_resource")
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version