Menu

Problem buillding

Help
Bruno
2014-03-27
2014-05-16
  • Bruno

    Bruno - 2014-03-27

    Hi,

    I'm trying to compile wxHexEditor on Arch Linux but I'm getting error:

    cd udis86/libudis86; make
    make[1]: Entering directory '/home/bruno/workspace/wxhexeditor-code/udis86/libudis86'
    PYTHONPATH=../scripts /usr/bin/python ../libudis86/itab.py ../docs/x86/optable.xml
    File "../libudis86/itab.py", line 268
    print "error: invalid operand declaration: %s\n" % opr[i]
    ^
    SyntaxError: invalid syntax
    Makefile:704: recipe for target 'itab.c' failed
    make[1]: [itab.c] Error 1
    make[1]: Leaving directory '/home/bruno/workspace/wxhexeditor-code/udis86/libudis86'
    Makefile:67: recipe for target 'udis86/libudis86/.libs/libudis86.a' failed
    make:
    [udis86/libudis86/.libs/libudis86.a] Error 2

    I've just cloned the repository from Sourceforge.

    Wx configuration:
    ~/workspace/wxhexeditor-code ᐅ wx-config --list

    Default config is gtk2-unicode-3.0
    

    Default config will be used for output

    Alternate matches:
    gtk2-unicode-3.1

    Python:
    /usr/bin ᐅ l |grep python
    lrwxrwxrwx 1 root root 7 Mar 9 23:34 python -> python3
    lrwxrwxrwx 1 root root 9 Fev 26 00:08 python2 -> python2.7
    -rwxr-xr-x 1 root root 6,1K Fev 26 00:08 python2.7
    -rwxr-xr-x 1 root root 1,7K Fev 26 00:08 python2.7-config
    lrwxrwxrwx 1 root root 16 Fev 26 00:08 python2-config -> python2.7-config
    lrwxrwxrwx 1 root root 9 Mar 9 23:34 python3 -> python3.3
    -rwxr-xr-x 2 root root 11K Mar 9 23:34 python3.3
    lrwxrwxrwx 1 root root 17 Mar 9 23:34 python3.3-config -> python3.3m-config
    -rwxr-xr-x 2 root root 11K Mar 9 23:34 python3.3m
    -rwxr-xr-x 1 root root 2,0K Mar 9 23:34 python3.3m-config
    lrwxrwxrwx 1 root root 16 Mar 9 23:34 python3-config -> python3.3-config
    lrwxrwxrwx 1 root root 14 Mar 9 23:34 python-config -> python3-config

    Thank you in advance for the help!

     
  • Death Knight®

    Death Knight® - 2014-03-28

    Himm. It's related with libudis.
    I don't exactly know why it doesn't working on your distro.
    But I guess it's about "python3"

    At python3, developers decide using "print(...)" structure instead of beautiful syntax of the "print"
    So that error line :

    print "error: invalid operand declaration: %s\n" % opr[i]

    doesn't python3 compatible and your "python" command points "python3"

    So you need to force using python2 version.
    this probably help of compiling libudis86 on arch:

    cd wxHexEditor/udis
    ./autogen.sh
    ./configure PYTHON=/usr/bin/python2
    make
    cd ..
    make

    The second make for build wxHexEditor.

     
  • Bruno

    Bruno - 2014-03-28

    Hi! Thank you for your help!
    The python error is not occouring anymore, but,

    trying to compile with wxgtk3.0, error:

    make OPTFLAGS="-fopenmp"
    wx-config --cxx -c wx-config --cxxflags -Iudis86 -Imhash/include -MMD -fopenmp -fopenmp src/HexEditorCtrl/HexEditorCtrl.cpp -o src/HexEditorCtrl/HexEditorCtrl.o
    src/HexEditorCtrl/HexEditorCtrl.cpp: In member function ‘virtual void HexEditorCtrl::OnResize(wxSizeEvent&)’:
    src/HexEditorCtrl/HexEditorCtrl.cpp:632:42: error: ‘temp’ was not declared in this scope
    for( int x = 0, i=0 ; x < hex_x and i < temp.Len() ; x++ )
    ^
    src/HexEditorCtrl/HexEditorCtrl.cpp: In member function ‘bool HexEditorCtrl::LoadTAGS(wxFileName)’:
    src/HexEditorCtrl/HexEditorCtrl.cpp:831:77: warning: ‘wxString wxXmlNode::GetPropVal(const wxString&, const wxString&) const’ is deprecated (declared at /usr/local/include/wx-3.0/wx/xml/xml.h:228) [-Wdeprecated-declarations]
    wxString propvalue = child->GetPropVal(wxT("id"), wxT("default-value"));
    ^
    Makefile:56: recipe for target 'src/HexEditorCtrl/HexEditorCtrl.o' failed
    make: *** [src/HexEditorCtrl/HexEditorCtrl.o] Error 1

    and trying to compile with wxgtk3.1, another error:

    wx-config --cxx -c wx-config --cxxflags -Iudis86 -Imhash/include -MMD -fopenmp -fopenmp src/HexEditorApp.cpp -o src/HexEditorApp.o
    src/HexEditorApp.cpp: In member function ‘bool wxHexEditorApp::SetLanguage()’:
    src/HexEditorApp.cpp:91:32: error: ‘wxLOCALE_CONV_ENCODING’ was not declared in this scope
    if ( !myLocale.Init( langid, wxLOCALE_CONV_ENCODING) ){
    ^
    Makefile:56: recipe for target 'src/HexEditorApp.o' failed
    make: *** [src/HexEditorApp.o] Error 1

    what is the right version of wx?

    thanks!!

     
  • Death Knight®

    Death Knight® - 2014-04-02

    Sorry for lateness.
    You could to compile wxHexEditor with wx2.8 or wx3.0. I don't think if there is wxgtk3.1 available right now since latest version at wxWidgets is 3.0.0.

    I don't know which version of wxHexEditor do you trying to build but you are better try to build latest svn trunk of wxHexEditor.

    Thanks.

     
  • Bruno

    Bruno - 2014-05-02

    Hi, sorry for the lateness too.
    Still the same problem.

    Here is the version of wx:
    ~/workspace/wxhexeditor-code ᐅ wx-config --version
    3.1.0

    The error:
    ~/workspace/wxhexeditor-code ᐅ make
    wx-config --cxx -c wx-config --cxxflags -Iudis86 -Imhash/include -MMD -fopenmp src/HexEditorApp.cpp -o src/HexEditorApp.o
    src/HexEditorApp.cpp: In member function ‘void wxHexEditorApp::SetLanguage()’:
    src/HexEditorApp.cpp:98:31: error: ‘wxLOCALE_CONV_ENCODING’ was not declared in this scope
    if ( !myLocale.Init( langid, wxLOCALE_CONV_ENCODING) ){
    ^
    Makefile:55: recipe for target 'src/HexEditorApp.o' failed
    make: *** [src/HexEditorApp.o] Error 1

     
  • Death Knight®

    Death Knight® - 2014-05-02

    Well, I think it's an issue on your wxWidgets package because wx3.1 version NOT released yet.
    https://www.wxwidgets.org/downloads/

    Also found some other information.
    About it, that issue doesn't affect Unicode builds, only the legacy ANSI one.
    That's why I have no issues with it.

    I removed "wxLOCALE_CONV_ENCODING" flag since it's default.
    So probably you cannot see this issue on r442
    Thanks.

     
    • Bruno

      Bruno - 2014-05-05

      Good,

      The error is not appearing anymore, but I got another:

      ~/workspace/wxhexeditor-code ᐅ make
      wx-config --cxx -c wx-config --cxxflags -Iudis86 -Imhash/include -MMD -fopenmp src/HexDialogs.cpp -o src/HexDialogs.o
      src/HexDialogs.cpp: In member function ‘wxString ChecksumDialog::CalculateChecksum(FAL&, int)’:
      src/HexDialogs.cpp:2693:4: error: expected ‘#pragma omp section’ or ‘}’ before ‘for’
      }
      ^
      Makefile:55: recipe for target 'src/HexDialogs.o' failed
      make: *** [src/HexDialogs.o] Error 1

      ps: changed wx to 3.0.0

      Thanks!

       
  • Death Knight®

    Death Knight® - 2014-05-07

    I think I can't help you about this error much. Looks like due an OpenMP support of your compiler. What is it's name/version?

    You can try to delete -fopenmp flag.
    I mean you can run this command manually

    wx-config --cxx -c wx-config --cxxflags -Iudis86 -Imhash/include -MMD src/HexDialogs.cpp -o src/HexDialogs.o

    and look what happens.

     
  • Bruno

    Bruno - 2014-05-08

    Finally it is running, but with some errors. The steps I took:

    1) build udis with python2 like you said.
    2) change WXLDFLAGS of Makefile of wxhexeditor to:
    WXLDFLAGS = $(WXCONFIG) --libs all
    ... it not include the aui without 'all' option, at least for me, I compiled version 3.0.0 of wxwidgets again from source.
    3) comment the -fopenmp of the same Makefile.

    The errors now are, just opening wxHexEditor:

    ../src/gtk/textctrl.cpp(833): assert "IsSingleLine()" failed in GetEditable(): shouldn't be called for multiline

    ../src/common/sizer.cpp(1401): assert "Assert failure" failed in DoInsert(): too many items (5 > 2*2) in grid sizer (maybe you should omit the number of either rows or columns?)

    and it throws me an error saying that my language is not supported (pt_BR)

    do you have an idea of the cause of these errors?

    thanks!

     
  • Death Knight®

    Death Knight® - 2014-05-09

    AAaahhh!!! wxAUI... This was drive me mad. Thank you Bruno.
    I am really annoyed with missing wxaui libs on compilation for wx3.0.
    You give the fix! I fix the make file right now on local repo.

    Unfortunately, I want to enable openmp default for faster read on SSD drives.

    AFAIK, those assertions are due wxWidgets code. Not related with my code. Right?

    And I don't understand why that error (pt_BR) shown on your computer. Because pr_BR is supported.
    Cause of this error is that: Your registry file (~/.wxHexEditor) says that language is Brazilian but wxHexEditor cannot find the compiled file.

    It looks 2 locations at linux: Distros default language files location (/usr/share/locale/pt_BR/LC_MESSAGES/wxHexEditor.mo) or local directory (local/pt_BR/wxHexEditor.mo)

    Thank you again for wx-config --libs all
    :)

     
  • dennis waters

    dennis waters - 2014-05-10

    I get the same error messages when compiled against wxgtk-3.0.0

    If I compile against wxgtk-2.8, everything is fine, or so it seems!

     
  • dennis waters

    dennis waters - 2014-05-10

    This type of message with wxgtk3. On opening or closing the program

     
  • Bruno

    Bruno - 2014-05-10

    It is good to hear that it helped.

    How about forcing python2 instead of using the default of the system? Don't you think isn't it a better idea?

    The exactly errors when opening wxHexEditor here are, in sequence:

    executing from the command line:

    1) ../src/gtk/textctrl.cpp(833): assert "IsSingleLine()" failed in GetEditable(): shouldn't be called for multiline (it also appears on a messageBox)

    2) ../src/common/sizer.cpp(1401): assert "Assert failure" failed in DoInsert(): too many items (5 > 2*2) in grid sizer (maybe you should omit the number of either rows or columns?)(it also appears on a messageBox, again)

    3) this appears only on a messageBox and when wxHexEditor is just opened, everytime I run it:

    Cannot set locale to language "English"
    locale 'en_GB' cannot be set.
    This language is not supported by the system.

    In .wxHexEditor in my home folder there is:
    Language=English

    My locale (/etc/locale.conf) is:
    LANG=pt_BR.UTF-8

     
  • Death Knight®

    Death Knight® - 2014-05-11

    Forcing python2 is not so good approach.
    Indeed libudis code is not wxHexEditor part but an included library.
    Might https://github.com/jlegewie/Py2to3 code could convert the file to make it compatible with py3.0

    Assertions due wxWidgets library.
    ../src/gtk/textctrl.cpp
    and
    ../src/common/sizer.cpp
    files doesn't belong to wxHexEditor but wxWidgets Library.
    Don't know why those assertions are triggered. This could be a bug report for future inspection... If you don't use debug version of wxWidgets library, assertions will not shown.

    And about language issue, I don't know why it happens on your PC. English is default language. This could converted into bug tracker also.

     
  • dennis waters

    dennis waters - 2014-05-11

    Ahh, thanks for that! compiled with BUILD=release and no more "assertion failed" messages!

     
  • Death Knight®

    Death Knight® - 2014-05-11

    I updated libudis now. This 'might' solve python 3.0 issue.

    Also default language is "en_us" but your system think it as en_GB somehow.
    if you can play wxHexEditorApp.cpp line 88:
    void wxHexEditorApp::SetLanguage(void)

    I believe you can track down the problem.
    Since the error not visible on my system, can't fix it blindly.
    All I can say:
    int langid = 58 for English.
    What is it on your system?

     
  • Bruno

    Bruno - 2014-05-12

    Hi,

    Tried everything from scratch now:

    autoreconf: running: aclocal --force -I build/m4
    aclocal: error: configure.ac:10: file 'm4/ax_compare_version.m4' does not exist

    Did you forget to add some files?

     
  • dennis waters

    dennis waters - 2014-05-13

    r445 sort-of compiles OK (please see my bug ticket)... but I get the assertion error messages even with BUILD=release

     
  • dennis waters

    dennis waters - 2014-05-13

    http://wiki.wxwidgets.org/Reducing_Executable_Size

    "Since wxWidgets 2.9, debug and release builds have been somewhat unified, which means that assertions will still be compiled in release builds of wxWidgets by default. So to fully remove assertions you'll need to make a release build where debugging support is completely removed (--disable-debug) if you don't make use of them in release builds. "

    Not sure where to add that in the makefile though

     
  • Death Knight®

    Death Knight® - 2014-05-13

    dennis, you have to compile "wxWidgets" with --disable-debug config.
    Nothing to do with wxHexEditor.

     
  • Bruno

    Bruno - 2014-05-14

    Good, it is compiling. But errors when using -openmp still.

    I have taken a rapid look at SetLanguage function. Look the way I modified it:

    https://gist.github.com/brunoeagle/6fab968b8029976faea8

    What do you think? PS: I could not test it on Windows or Mac.

    The assertion warnings persists here. It is strange, I use another software with wxWidgets and I get no warning at all.

     
  • Death Knight®

    Death Knight® - 2014-05-15

    I think this code is better:

    void wxHexEditorApp::SetLanguage(void){
    wxString lang = wxConfigBase::Get()->Read( _T("Language"), wxEmptyString );
    
    if ( lang.IsEmpty() )
        lang= wxLocale::GetLanguageName( wxLocale::GetSystemLanguage() );
    
    if ( wxLocale::FindLanguageInfo( lang ) == NULL )
        lang=wxT("English"); //Defaulting to english.
    
    wxConfigBase::Get()->Write( _T("Language"), lang );
    wxConfigBase::Get()->Flush();
    
    int langid = wxLocale::FindLanguageInfo( lang )->Language;
    
    if ( !myLocale.Init( langid ) ){
        wxLogError(_T("This language is not supported by the system."));
        return;
        }
    ...
    
     
  • Bruno

    Bruno - 2014-05-16

    wxConfigBase::Get() actually read Language, and it returns "English" to lang.

    But it doesn't work. I got the message that the language cannot be set.

    When I use directly GetSystemLanguage, it works and pt_BR is set.

    Do you have an idea what is going wrong?

    I've compiled wxWidgets 3.0.0 without any customizations.

     
  • Death Knight®

    Death Knight® - 2014-05-16

    "wxConfigBase::Get()" takes wxConfigBase object for reading/writing operations.

    First line try to read from registry. If it successful, stores to "lang".

    If there is no registry info for "Language" key, than it takes system language with "GetSystemLanguage".

    If with local language, wxLocale::FindLanguageInfo(lang) returns NULL than defaults to english.

    Than init the myLocale...

    At your scenario, you have "Language=English" at your registry. So that's why wxHexEditor try to run in English mode.

    "Language cannot be set" error is weird. Because if

    lang=wxT("English")

    than:

    int langint = 58 = wxLocale::FindLanguageInfo( lang )->Language;

    Which is supported.

     

Log in to post a comment.