Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manager fails to link with wxWidgets 3.1 #2271

Closed
JuhaSointusalo opened this issue Dec 10, 2017 · 21 comments · Fixed by #3050
Closed

Manager fails to link with wxWidgets 3.1 #2271

JuhaSointusalo opened this issue Dec 10, 2017 · 21 comments · Fixed by #3050

Comments

@JuhaSointusalo
Copy link
Contributor

When building Manager with wxWidgets 3.1 linking fails with the following error:

  CXXLD    boincmgr
boincmgr-NoticeListCtrl.o: In function `CNoticeListCtrl::Create(wxWindow*)':
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/NoticeListCtrl.cpp:87: undefined reference to `wxWebViewNameStr'
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/NoticeListCtrl.cpp:87: undefined reference to `wxWebViewBackendDefault'
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/NoticeListCtrl.cpp:87: undefined reference to `wxWebViewDefaultURLStr'
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/NoticeListCtrl.cpp:87: undefined reference to `wxWebView::New(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, wxString const&, long, wxString const&)'
boincmgr-NoticeListCtrl.o: In function `wxEventTableEntry':
/home/juha/dev/wxwidgets/inst-3.1.0/usr/local/include/wx-3.1/wx/event.h:3182: undefined reference to `wxEVT_WEBVIEW_NAVIGATING'
/home/juha/dev/wxwidgets/inst-3.1.0/usr/local/include/wx-3.1/wx/event.h:3182: undefined reference to `wxEVT_WEBVIEW_ERROR'
boincmgr-DlgItemProperties.o: In function `CDlgItemProperties::CDlgItemProperties(wxWindow*)':
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/DlgItemProperties.cpp:65: undefined reference to `wxWebViewNameStr'
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/DlgItemProperties.cpp:65: undefined reference to `wxWebViewBackendDefault'
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/DlgItemProperties.cpp:65: undefined reference to `wxWebViewDefaultURLStr'
/home/juha/dev/boinc/build-wx3.1.0/clientgui/../../src/clientgui/DlgItemProperties.cpp:65: undefined reference to `wxWebView::New(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, wxString const&, long, wxString const&)'
collect2: error: ld returned 1 exit status

This is because BOINC configure doesn't request any particular set of wxWidgets components and wxWebView is no longer part of the standard set in 3.1.

3.0:

$ wx-config --libs
-L/usr/local/lib -pthread   -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_webview-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

3.1

$ wx-config --libs
-L/usr/local/lib -pthread   -lwx_gtk2u_xrc-3.1 -lwx_gtk2u_html-3.1 -lwx_gtk2u_qa-3.1 -lwx_gtk2u_adv-3.1 -lwx_gtk2u_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
@CharlieFenton
Copy link
Contributor

CharlieFenton commented Dec 11, 2017 via email

@JuhaSointusalo
Copy link
Contributor Author

JuhaSointusalo commented Dec 11, 2017 via email

@AenBleidd
Copy link
Member

I think this is fixed via #2190 so I'm closing this ticket.
If you have any objections feel free to reopen it.

Client and Manager automation moved this from Backlog to Done Feb 6, 2018
@JuhaSointusalo
Copy link
Contributor Author

It's actually a different issue. In 3.0 wx-config --libs includes webview if wxWidgets was built with it. In 3.1 webview is not included in --libs by default and it is necessary to call wx-config with something like --libs std,webview.

This issue is related to #2190 in that webview needs to be included optionally. wx-config can do that but the Autoconf macro can't. So I need to patch the Autoconf macro, maybe send it upstream and then snag the updated macro back here. At first I thought this was one line change but it's a bit more than that.

@JuhaSointusalo JuhaSointusalo reopened this Feb 6, 2018
Client and Manager automation moved this from Done to TODO - Ready to Implement Feb 6, 2018
@AenBleidd
Copy link
Member

Is this still an issue?

@CharlieFenton
Copy link
Contributor

This has never been an issue on Macintosh, because you cannot build the Manager or wxWidgets for BOINC on a Macintosh using autotools / autoconf.

One builds wxWidgets 3.1.0 on Macintosh using the shell script buildwxMac.sh. The script does patch a few files in wxWidgets and builds it using the Xcode project included with wxWidgets. The script also defines WK_API_ENABLED=0 in order to use legacy WebKit APIs.

@candrews
Copy link
Contributor

candrews commented Dec 5, 2018

Gentoo (see https://bugs.gentoo.org/587462 ) is using this patch to fix the issue, perhaps it would be acceptable?

--- a/configure.ac	2016-07-06 11:16:41.000000000 +0200
+++ b/configure.ac	2016-07-06 11:45:51.088155620 +0200
@@ -1250,7 +1250,7 @@
     CLIENTGUIFLAGS="${CLIENTGUIFLAGS} -DNDEBUG"
 fi
 
-CLIENTGUILIBS="${WX_LIBS} ${SQLITE3_LIBS}"
+CLIENTGUILIBS="${WX_LIBS} $($WX_CONFIG_WITH_ARGS --libs webview) ${SQLITE3_LIBS}"
 
 if test "${enable_client_release}" = "yes" ; then
    if test "x${WX_LIBS_STATIC}" = "x" ; then

@jurobystricky
Copy link

Gentoo (see https://bugs.gentoo.org/587462 ) is using this patch to fix the issue, perhaps it would be acceptable?

--- a/configure.ac	2016-07-06 11:16:41.000000000 +0200
+++ b/configure.ac	2016-07-06 11:45:51.088155620 +0200
@@ -1250,7 +1250,7 @@
     CLIENTGUIFLAGS="${CLIENTGUIFLAGS} -DNDEBUG"
 fi
 
-CLIENTGUILIBS="${WX_LIBS} ${SQLITE3_LIBS}"
+CLIENTGUILIBS="${WX_LIBS} $($WX_CONFIG_WITH_ARGS --libs webview) ${SQLITE3_LIBS}"
 
 if test "${enable_client_release}" = "yes" ; then
    if test "x${WX_LIBS_STATIC}" = "x" ; then

This fixed the issue for me

@ChristianBeer
Copy link
Member

I'll take a look at this over the weekend.

@JuhaSointusalo
Copy link
Contributor Author

I haven't kept any hurry with this because 3.1 is still in development. Though confusingly the release announcement for 3.1.2 says it's both development version but also good for production. Go figure.

The Gentoo patch doesn't work for us because it links to wxWebView unconditionally.

@AenBleidd
Copy link
Member

AenBleidd commented Feb 8, 2019

Is wxWebView still a requirement? As far as I remember we had some PRs to exclude it because it is unsupportable on some linux distros.

Upd: Here it is: #2190

@JuhaSointusalo
Copy link
Contributor Author

Yep, preferred but conditional.

@JuhaSointusalo
Copy link
Contributor Author

#3010 has an initial draft of what needs to be done to fix this issue.

@CharlieFenton
Copy link
Contributor

@candrews and others: You may also want to take a look at the patches to wxWidgets 3.1.0 I found necessary for the Macintosh, though these have nothing to do with being able to link to it. They are in the script in the BOINC source tree at mac_build/buildWxMac.sh. I don't know if they are relevant to Gentoo.

@ChristianBeer
Copy link
Member

I found some more issues when building against wxwidgets 3.1.2. Mainly deprecated constants that were removed in 3.1. Now investigating the linking issue.

Client and Manager automation moved this from TODO - Ready to Implement to Done Mar 21, 2019
@serval2412
Copy link
Contributor

On pc Debian x86-64 testing updated today with boinc sources from git master branch updated today, I still got this error:
/usr/bin/ld: boincmgr-NoticeListCtrl.o: warning: relocation against wxWebViewBackendDefault' in read-only section .text'
/usr/bin/ld: boincmgr-NoticeListCtrl.o: in function CNoticeListCtrl::Create(wxWindow*)': NoticeListCtrl.cpp:(.text+0xcca): undefined reference to wxWebViewNameStr'
/usr/bin/ld: NoticeListCtrl.cpp:(.text+0xdda): undefined reference to wxWebViewBackendDefault' /usr/bin/ld: NoticeListCtrl.cpp:(.text+0xf0f): undefined reference to wxWebViewDefaultURLStr'
/usr/bin/ld: NoticeListCtrl.cpp:(.text+0x1056): undefined reference to wxWebView::New(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, wxString const&, long, wxString const&)' /usr/bin/ld: boincmgr-NoticeListCtrl.o: in function _GLOBAL__sub_I__ZN15CNoticeListCtrl12ms_classInfoE':
NoticeListCtrl.cpp:(.text.startup+0x11e): undefined reference to wxEVT_WEBVIEW_NAVIGATING' /usr/bin/ld: NoticeListCtrl.cpp:(.text.startup+0x170): undefined reference to wxEVT_WEBVIEW_ERROR'

extract from config.log:
configure:31476: checking for wxWidgets version >= 3.0.0 ( --unicode=yes)
configure:31519: result: yes (version 3.0.5)

I followed website:
./_autosetup
./configure --disable-server --enable-client CXXFLAGS="-O3 "
make clean (to be sure there wasn't any old remnants)
make

@AenBleidd
Copy link
Member

Looks similar to #4010

@CharlieFenton
Copy link
Contributor

Please see #3050 and #2190

@serval2412
Copy link
Contributor

@CharlieFenton: indeed.

I finally succeeded with the first "make" but after:
cd packages/generic/sea
make
I got:
mkdir -p BOINC
cp ../../../stage//usr/local/bin/boinc BOINC/boinc
cp ../../../stage//usr/local/bin/boincmgr BOINC/boincmgr
cp: cannot stat '../../../stage//usr/local/bin/boincmgr': No such file or directory
make: *** [Makefile:585: BOINC/boincmgr] Error 1

Indeed, I don't have dir "boincmgr" in "boinc/stage/usr/local/bin", I got only:
"boinc", "boinc_client", "boinccmd" and "switcher"

(BTW, @CharlieFenton: I tried to send you an email but it failed. It was concerning a warning during build:
CXX libboinc_la-gui_rpc_client_ops.lo
gui_rpc_client_ops.cpp: In member function ‘int RPC_CLIENT::run_graphics_app(const char*, int&, const char*)’:
gui_rpc_client_ops.cpp:1978:10: warning: variable ‘stop’ set but not used [-Wunused-but-set-variable]
1978 | bool stop = false;
| ^~~~ )

@CharlieFenton
Copy link
Contributor

@serval2412 Sorry, I don't have a Linux system; I just remembered that this issue had been mentioned before and did a search for the previous references. But I did notice in your post that these paths have a double // between stage and usr:
cp ../../../stage//usr/local/bin/boinc BOINC/boinc
cp ../../../stage//usr/local/bin/boincmgr BOINC/boincmgr
cp: cannot stat '../../../stage//usr/local/bin/boincmgr': No such file or directory
Could that be contributing to this error?

gui_rpc_client_ops.cpp:1978:10: warning: variable ‘stop’ set but not used [-Wunused-but-set-variable]
I suspect you can ignore this warning; I doubt that it is a problem.

@serval2412
Copy link
Contributor

@CharlieFenton: the double "//" isn't "clean" but has no effect.
Indeed, "cp ../../../stage//usr/local/bin/boinc BOINC/boinc" worked, only "cp ../../../stage//usr/local/bin/boincmgr BOINC/boincmgr" didn't work.
Just for curiosity, do you have a subdir "boincmgr" in "boinc/stage/usr/local/bin" on your local repo ?

Concerning "stop", does it mean "stop" variable could also be completely removed and so comment be changed accordingly:

// <operaton can be "run", "runfullscreen" or "stop"

->

// <operation can be "run", "runfullscreen"
?
I think it's always interesting to remove unused/dead parts so the code is a bit more maintainable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants