lintest / myrulib

Кроссплатформенная оболочка для электронной библиотеки fb2-файлов
http://myrulib.lintest.ru
GNU General Public License v3.0
129 stars 37 forks source link

Не собирается в Linux Mint 18 Sarah #13

Open telzhov opened 7 years ago

telzhov commented 7 years ago

Здравствуйте!

Пытаюсь собрать проект из исходников, поскольку установка из deb в последнем Linux Mint, увы, перестала работать. Компилятор (g++ 5) жалуется, что не может применить new к абстрактному классу (я не понял, почему именно он решил, что класс абстрактный). С ходу не смог разобраться, в чем дело, может поможете? Вот лог запуска ./configure и make.

Спасибо!

qwazer commented 7 years ago

the same issue

g++ --version
g++ (Debian 6.2.1-5) 6.2.1 20161124
./sources/MyRuLib/controls/FbNotebook.cpp: In member function ‘virtual wxAuiTabArt* FbMozillaTabArt::Clone()’:
./sources/MyRuLib/controls/FbNotebook.cpp:2355:47: error: invalid new-expression of abstract class type ‘FbMozillaTabArt’
  FbMozillaTabArt* clone = new FbMozillaTabArt();
                                               ^
In file included from ./sources/MyRuLib/controls/FbNotebook.cpp:5:0:
./sources/MyRuLib/controls/FbNotebook.h:284:7: note:   because the following virtual functions are pure within ‘FbMozillaTabArt’:
 class FbMozillaTabArt : public FbBaseTabArt
       ^~~~~~~~~~~~~~~
In file included from /usr/include/wx-3.0/wx/aui/auibook.h:24:0,
                 from ./sources/MyRuLib/controls/FbNotebook.h:4,
                 from ./sources/MyRuLib/controls/FbNotebook.cpp:5:
/usr/include/wx-3.0/wx/aui/tabart.h:58:18: note:    virtual void wxAuiTabArt::DrawBorder(wxDC&, wxWindow*, const wxRect&)
     virtual void DrawBorder(
                  ^~~~~~~~~~
/usr/include/wx-3.0/wx/aui/tabart.h:102:17: note:   virtual int wxAuiTabArt::GetBorderWidth(wxWindow*)
     virtual int GetBorderWidth(
                 ^~~~~~~~~~~~~~
/usr/include/wx-3.0/wx/aui/tabart.h:105:17: note:   virtual int wxAuiTabArt::GetAdditionalBorderSpace(wxWindow*)
     virtual int GetAdditionalBorderSpace(
                 ^~~~~~~~~~~~~~~~~~~~~~~~
Makefile:673: recipe for target 'myrulib_FbNotebook.o' failed
make: *** [myrulib_FbNotebook.o] Error 1
mindlessengineer commented 7 years ago

This occured perhaps due to wxwidgets-3.0. It introduced new methods in abstract classes. I put several stubs into the code in order to make it buildable on Debian "Stretch"/amd64. I am no expert in wxwidgets, I am even no software developer at all. I would expect possible problems with drawing borders, occasional crashes with search boxes and compilation for different architectures. In my environment it just runs without any problem. Some kind of untested instruction: unzip myrulib source code, unzip this patch, enter the directory of myrulib, use patch -p1 -i ../myrulib-0.29.16-stretch.patch.txt.

mindlessengineer commented 7 years ago

Unfortunately I cannot upload a patch file here. It looks like my browser is far from being perfect, so am I.

mindlessengineer commented 7 years ago

diff -crB myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.cpp myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.cpp *** myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.cpp 2013-09-03 22:30:45.000000000 +0400 --- myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.cpp 2017-03-26 08:35:01.738502484 +0300


* 938,943 ** --- 938,963 ---- m_activeColour = colour; }

+ void WxAuiDefaultTabArt::DrawBorder( + wxDC& dc, + wxWindow wnd, + const wxRect& rect) + { + return; + } + + int WxAuiDefaultTabArt::GetBorderWidth( + wxWindow wnd) + { + return 2; + } + + int WxAuiDefaultTabArt::GetAdditionalBorderSpace( + wxWindow* wnd) + { + return 2; + } + // -- WxAuiSimpleTabArt class implementation --

WxAuiSimpleTabArt::WxAuiSimpleTabArt()


* 1379,1385 ** --- 1399,1423 ---- { m_measuringFont = font; } + void WxAuiSimpleTabArt::DrawBorder( + wxDC& dc, + wxWindow wnd, + const wxRect& rect) + { + return; + } + + int WxAuiSimpleTabArt::GetBorderWidth( + wxWindow wnd) + { + return 2; + }

+ int WxAuiSimpleTabArt::GetAdditionalBorderSpace( + wxWindow* wnd) + { + return 2; + } //----------------------------------------------------------------------------- // FbBaseTabArt //----------------------------------------------------------------------------- diff -crB myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.h myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.h *** myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.h 2013-09-03 22:30:45.000000000 +0400 --- myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbNotebook.h 2017-03-26 08:34:15.565827310 +0300


* 74,79 ** --- 74,88 ---- const wxAuiNotebookPageArray& pages, const wxSize& requiredBmpSize);

+ void DrawBorder( + wxDC& dc, + wxWindow wnd, + const wxRect& rect); + + int GetBorderWidth( + wxWindow wnd); + int GetAdditionalBorderSpace( + wxWindow* wnd); protected:

  wxFont m_normalFont;

* 161,166 ** --- 170,184 ---- int GetBestTabCtrlSize(wxWindow wnd, const wxAuiNotebookPageArray& pages, const wxSize& requiredBmpSize); + void DrawBorder( + wxDC& dc, + wxWindow wnd, + const wxRect& rect); + + int GetBorderWidth( + wxWindow wnd); + int GetAdditionalBorderSpace( + wxWindow wnd);

protected:

diff -crB myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.cpp myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.cpp *** myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.cpp 2013-09-03 22:30:45.000000000 +0400 --- myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.cpp 2017-03-25 21:47:32.477639864 +0300


* 1193,1197 ** --- 1193,1205 ---- GetSize(&width, &height); LayoutControls(0, 0, width, height); } + GtkEditable FbSearchCtrl::GetEditable() const + { + return NULL; + } + GtkEntry FbSearchCtrl::GetEntry() const + { + return NULL; + }

endif // FB_SEARCH_COMBO_CTRL

diff -crB myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.h myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.h *** myrulib-0.29.16/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.h 2013-09-03 22:30:45.000000000 +0400 --- myrulib-0.29.16-patched/myrulib-0.29.16/sources/MyRuLib/controls/FbSearchCtrl.h 2017-03-26 08:33:42.857350786 +0300


* 298,303 ** --- 298,305 ---- wxBitmap m_cancelBitmap;

private: + GtkEditable GetEditable() const; + GtkEntry GetEntry() const; DECLARE_DYNAMIC_CLASS(FbSearchCtrl)

  DECLARE_EVENT_TABLE()
sedoj33 commented 7 years ago

Thx you, now compiles!

telzhov commented 7 years ago

+1, works for me too, thank you! So trying to attach the zipped patch here: myrulib-0.29.16-stretch.patch.zip

PetroGolovnya commented 3 years ago

Program compiles with this path, but internal coolreader don`t start :(

2020/12/27 17:01:13.0000 WARN ldomNode::registerDocument() - new index = 0 2020/12/27 17:01:13.0000 WARN Disabling hyphenation 2020/12/27 17:01:13.0000 WARN CRGuiWindowManager::reconfigure( dx=1, dy=1, angle=0 2020/12/27 17:01:13.0000 WARN ldomNode::unregisterDocument() - for index 0 2020/12/27 17:01:13.0000 WARN Loading document /tmp/fbfLfqjg : fn=fbfLfqjg, dir=/tmp/ 2020/12/27 17:01:13.0000 WARN ldomNode::registerDocument() - new index = 1 2020/12/27 17:01:13.0000 ERROR Cannot open cached document: cache dir is not initialized 2020/12/27 17:01:13.0000 WARN Cannot open document from cache. Need to read fully 2020/12/27 17:01:13.0000 WARN Cannot get document from cache, parsing... OS - Fedora 31