News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Build error in SVN Rev. 1447 ( wxSmith )

Started by TheTuxKeeper, December 05, 2005, 01:39:26 PM

Previous topic - Next topic

TheTuxKeeper

When compiling the current svn rev. 1447, I get this error in the wxSmith directory:
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>


I build it with OpenSuse 10.0 wxGTK 2.6.1.

The rest compiles without any errors.

Daniel
Nightly builds for openSUSE

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?

// 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;
        }
    }

Nightly builds for openSUSE

cyberkoa

I try to compile on wxmsw unicode but no problem , I suspect is the following code that on the wxsprojects.cpp

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


can you try to change those #define to the following


#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

and try again . Let us know whether success or not , thx

TheTuxKeeper

I changed the #define lines, but the errors are the same :(
#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")
Nightly builds for openSUSE

mandrav

Quote from: daniel2000 on December 05, 2005, 06:41:22 PM
I changed the #define lines, but the errors are the same :(

wxSmith uses its own precompiled headers. The current build system does not keep them up-to-date automatically (it is my fault and I will fix it soon).
So, delete plugins/contrib/wxSmith/wxsheaders.h.gch and run make. Hopefully it will work.
Be patient!
This bug will be fixed soon...

TheTuxKeeper

think these errors came because I linked (symbolic link) the old cvs build directory to the new svn directory ( codeblocks-svn/build -> ../codeblocks-cvs/build) and make and the "../../"s went into the cvs directory  :shock:

Now it compiles and I think it'll work. If not I'll post :D

Thanks for the help

Daniel
Nightly builds for openSUSE

cyberkoa

Quote from: daniel2000 on December 05, 2005, 06:41:22 PM
I changed the #define lines, but the errors are the same :(
#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")


sorry , I think I hv made mistake , the TinyXML is not using wxString, please remove the _T() macro in the #define statement and recompile , else there may have run-time logical bug