2012年7月2日 星期一

Madedit crashed in Centos 6

After searching the internet, no one provides any solution for this issue.
Here is one solution.

OS: CentOS 6.3 x86_64

Syndrome:
installed by RPM
> madedit &
>> open new tab -> crashed and some message left in the terminal
'(core dumped) madedit'

Solution in 5 steps:
0. add additional lib for yum
> rpm -ivh ftp://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

1.
> yum install boost boost-devel   wxGTK wxGTK-devel gtk2-devel gcc-c++
(i686 version required)

2
>  cd   /usr/local/src/

> wget  http://downloads.sourceforge.net/project/madedit/MadEdit/MadEdit-0.2.9/madedit-0.2.9.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmadedit%2Ffiles%2FMadEdit%2FMadEdit-0.2.9%2F&ts=1347185903&use_mirror=nchc


> tar -zxvf madedit-0.2.9.tar.gz

> cd   /usr/local/src/madedit-0.2.9/src/MadEdit
> vi MadEdit.cpp
//
Modify some content around line 9716
It may looks like the following text.
The red and underlined lines should be inserted.

-----------------------------------------------------------------------
//--- line 9716 ---///
void MadEdit::OnPaint(wxPaintEvent &evt)
{
    //--- add to avoid crash ---//
    if(m_ClientWidth==0 || m_ClientHeight==0) return;
    //--- end ---///


    wxPaintDC dc(this);
    wxMemoryDC memdc, markdc;

    wxWindow *focuswin=FindFocus();

    if(InPrinting())
-----------------------------------------------------------------------

3.
> cd  /usr/local/src/madedit-0.2.9
> ./configure
> make
> make install

4.
 Done

[Ref]  http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=347254&start=15&sid=f4349b8a77616c9e3cda146aae2878e6&view=print
(you can also find the fixed deb package here. I didn't try this package yet.)



沒有留言:

張貼留言