vslavik / poedit

Translations editor for Mac, Windows and Unix
https://poedit.net
MIT License
1.77k stars 275 forks source link

v3.1.1: Compilation errors in Linux Mint 19.2 #768

Closed ghost closed 2 years ago

ghost commented 2 years ago

There is an error while compiling fileviewer.cpp which stops the entire operation. Also it is possible other errors could follow once that one gets fixed, if the issue stems from elsewhere. Unfortunately I do not know how to fix the code or whether there is an error on my part.

I have been using the v3.1.1 tar.gz package as published in Releases. EDIT: Just tested with v3.0.1 - exact same behavior. Dependencies appear to be alright. Please ask if more details are required.

Compilation log [click to show] ``` dragos@Samsung-R580:~/Downloads/Sources+scripts/poedit-3.1.1$ make Making all in src make[1]: Entering directory '/home/dragos/Downloads/Sources+scripts/poedit-3.1.1/src' CXX attentionbar.o CXX cat_update.o CXX cat_sorting.o CXX catalog.o CXX catalog_po.o CXX catalog_xliff.o CXX chooselang.o CXX colorscheme.o CXX commentdlg.o CXX concurrency.o CXX configuration.o CXX custom_buttons.o CXX customcontrols.o CXX custom_notebook.o CXX edapp.o In file included from welcomescreen.h:29:0, from edapp.cpp:98: titleless_window.h:32:24: warning: type attributes ignored after type is already defined [-Wattributes] class WXDLLIMPEXP_CORE wxButton; ^~~~~~~~ CXX edframe.o In file included from progressinfo.h:30:0, from edframe.cpp:77: titleless_window.h:32:24: warning: type attributes ignored after type is already defined [-Wattributes] class WXDLLIMPEXP_CORE wxButton; ^~~~~~~~ CXX editing_area.o CXX edlistctrl.o CXX export_html.o CXX extractors/extractor.o CXX extractors/extractor_gettext.o CXX extractors/extractor_legacy.o CXX filemonitor.o CXX fileviewer.o fileviewer.cpp: In constructor ‘FileViewer::FileViewer(wxWindow*)’: fileviewer.cpp:154:28: error: incomplete type ‘wxWebView’ used in nested name specifier m_content = wxWebView::New(panel, wxID_ANY); ^~~ fileviewer.cpp:156:16: error: invalid conversion from ‘wxWebView*’ to ‘int’ [-fpermissive] sizer->Add(m_content, 1, wxEXPAND); ^~~~~~~~~ In file included from fileviewer.cpp:38:0: /usr/include/wx-3.0/wx/sizer.h:1162:1: note: initializing argument 1 of ‘wxSizerItem* wxSizer::Add(int, int, int, int, int, wxObject*)’ wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData ) ^~~~~~~ fileviewer.cpp:165:17: error: invalid conversion from ‘wxWebView*’ to ‘size_t {aka long unsigned int}’ [-fpermissive] sizer->Hide(m_content); ^~~~~~~~~ In file included from fileviewer.cpp:38:0: /usr/include/wx-3.0/wx/sizer.h:705:10: note: initializing argument 1 of ‘bool wxSizer::Hide(size_t)’ bool Hide( size_t index ) ^~~~ fileviewer.cpp: In member function ‘void FileViewer::ShowHTMLContent(const wxString&)’: fileviewer.cpp:316:14: error: invalid use of incomplete type ‘class wxWebView’ m_content->GetContainingSizer()->Show(m_content); ^~ In file included from fileviewer.cpp:28:0: fileviewer.h:39:28: note: forward declaration of ‘class wxWebView’ class WXDLLIMPEXP_FWD_CORE wxWebView; ^~~~~~~~~ fileviewer.cpp:345:18: error: invalid use of incomplete type ‘class wxWebView’ m_content->SetPage(markup, "file:///"); ^~ In file included from fileviewer.cpp:28:0: fileviewer.h:39:28: note: forward declaration of ‘class wxWebView’ class WXDLLIMPEXP_FWD_CORE wxWebView; ^~~~~~~~~ Makefile:716: recipe for target 'fileviewer.o' failed make[1]: *** [fileviewer.o] Error 1 make[1]: Leaving directory '/home/dragos/Downloads/Sources+scripts/poedit-3.1.1/src' Makefile:485: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 ```
Dependencies check [click to show] ``` dragos@Samsung-R580:~/Downloads/Sources+scripts/poedit-3.1.1$ ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports nested variables... (cached) yes checking for install location... /usr/local checking for gawk... (cached) gawk checking whether ln -s works... yes checking for ranlib... ranlib checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking whether g++ supports C++14 features with -std=gnu++14... yes checking for boostlib >= 1.60 (106000)... yes checking whether the Boost::System library is available... yes checking for exit in -lboost_system... yes checking whether the Boost::Regex library is available... yes checking for exit in -lboost_regex... yes checking whether the Boost::Thread library is available... yes checking for exit in -lboost_thread... yes checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether the Boost::IOStreams library is available... yes checking for exit in -lboost_iostreams... yes checking cpprest/http_client.h usability... yes checking cpprest/http_client.h presence... yes checking for cpprest/http_client.h... yes checking for libcpprest >= 2.5... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBSECRET... yes checking nlohmann/json.hpp usability... yes checking nlohmann/json.hpp presence... yes checking for nlohmann/json.hpp... yes checking for wx-config... /usr/bin/wx-config checking for wxWidgets version >= 3.0.3 (--unicode)... yes (version 3.0.4) checking for wxWidgets static library... no checking if wxWidgets includes XRC... yes checking for wxrc... /usr/bin/wxrc checking for mkdtemp... yes checking for ICU... yes checking if wxWidgets toolkit uses GTK+ 3... no checking if wxWidgets toolkit uses GTK+ 2... yes checking for GTKSPELL... yes checking for LUCENE... yes checking for PUGIXML... no checking cld2/public/compact_lang_det.h usability... yes checking cld2/public/compact_lang_det.h presence... yes checking for cld2/public/compact_lang_det.h... yes checking for libcld2... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating artwork/Makefile config.status: creating locales/Makefile config.status: creating docs/Makefile config.status: executing depfiles commands Configured poedit-3.1.1 for x86_64-pc-linux-gnu Enabled features: * debug build: no * language detection: yes * crowdin integration: yes ```
vslavik commented 2 years ago

There is an error while compiling fileviewer.cpp which stops the entire operation.

If you compile from sources, instead of using precompiled packages, you need to be prepared to dig a bit deeper than that. Nobody else is going to install your outdated distro to reproduce.

Looking into the cause is nothing to be scared about, really. The compiler tells you what is wrong:

fileviewer.cpp:154:28: error: incomplete type ‘wxWebView’ used in nested name specifier

So your first thought shouldn't be "let's file a bug report!", but "Does the file include a header that declares wxWebView"? The compiler tells you which file, so open the file and check the headers. Yep, it does have #include <wx/webview.h>. So why doesn't that include wxWebView? I don't know. The answer is on your computer, in your system wx/webview.h header, which you can view, and which probably disables this part of wxWidgets, thus failing Poedit's requirement for full wxWidgets install.

Perhaps the configure check could be improved (PRs welcome), but the compilation failure cannot be fixed in Poedit.

ghost commented 2 years ago

My apologies for not living up to your expectations. I'm not a seasoned developer and the free space on the root partition is now less than 500MB after installing all kinds of development files in an attempt to make this work. So yeah, I'd say the configuration check could use some more attention.

xen0n commented 1 year ago

For other developers that landed on this issue: the error is likely because WebKit is disabled in the wxGTK installation used. Re-building wxGTK with the webview component enabled should fix the error.

vslavik commented 1 year ago

@xen0n Yes, you repeat what is explicitly spelled out above already. Poedit explicitly requires the webview component.