3.2.2.1 issue with webview Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
raananb
Super wx Problem Solver
Super wx Problem Solver
Posts: 488
Joined: Fri Oct 27, 2006 4:35 pm
Location: Paris, France
Contact:

3.2.2.1 issue with webview

Post by raananb »

Windows 10 & Visual Studio Community 2022.

1. When VS builds my application - which uses wxWebView - with wxWidgets-3.2.1 there are no problems.

Code: Select all

3.2.1
1>   Creating library VCProjectDebug\AccountsManager.lib and object VCProjectDebug\AccountsManager.exp
1>AccountsManager.vcxproj -> D:\ProjetsDB\AccountsManager2\VCProjectDebug\AccountsManager.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
========== Rebuild started at 10:11 AM and took 08:40,150 minutes ==========
2. wxWidgets-3.2.2.1 builds with no errors, and webview sample builds and runs as expected:

Code: Select all

1>webview.cpp
1>webview_vc9.vcxproj -> D:\wxWidgets-3.2.2.1\samples\webview\vc_x64_mswud\webview.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
========== Rebuild started at 11:39 AM and took 09,599 seconds ==========
3. When I try to build the application with 3.2.2.1 I am getting errors where webview is concerned:

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: static class wxWebView * __cdecl wxWebView::New(class wxString const &)" (?New@wxWebView@@SAPEAV1@AEBVwxString@@@Z) referenced in function "public: void __cdecl GetExchangeRate::CheckExchangeRate(class wxArrayString *,class wxString,class wxArrayDouble *,bool *)" (?CheckExchangeRate@GetExchangeRate@@QEAAXPEAVwxArrayString@@VwxString@@PEAVwxArrayDouble@@PEA_N@Z)	AccountsManager	D:\ProjetsDB\AccountsManager2\getexchangerate.obj	1	
Error	LNK2001	unresolved external symbol "public: static class wxWebView * __cdecl wxWebView::New(class wxString const &)" (?New@wxWebView@@SAPEAV1@AEBVwxString@@@Z)	AccountsManager	D:\ProjetsDB\AccountsManager2\getsharequote.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxWebViewNameStr" (?wxWebViewNameStr@@3QBDB)	AccountsManager	D:\ProjetsDB\AccountsManager2\getexchangerate.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxWebViewNameStr" (?wxWebViewNameStr@@3QBDB)	AccountsManager	D:\ProjetsDB\AccountsManager2\getsharequote.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxWebViewBackendDefault" (?wxWebViewBackendDefault@@3QBDB)	AccountsManager	D:\ProjetsDB\AccountsManager2\getexchangerate.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxWebViewBackendDefault" (?wxWebViewBackendDefault@@3QBDB)	AccountsManager	D:\ProjetsDB\AccountsManager2\getsharequote.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxWebViewEvent> const wxEVT_WEBVIEW_LOADED" (?wxEVT_WEBVIEW_LOADED@@3V?$wxEventTypeTag@VwxWebViewEvent@@@@B)	AccountsManager	D:\ProjetsDB\AccountsManager2\getexchangerate.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxWebViewEvent> const wxEVT_WEBVIEW_LOADED" (?wxEVT_WEBVIEW_LOADED@@3V?$wxEventTypeTag@VwxWebViewEvent@@@@B)	AccountsManager	D:\ProjetsDB\AccountsManager2\getsharequote.obj	1	
The following statements are present at the two objects which use webview.

Code: Select all

#include "wx/webview.h"

#if wxUSE_WEBVIEW_IE
#include "wx/msw/webview_ie.h"
#endif
#if wxUSE_WEBVIEW_EDGE
#include "wx/msw/webview_edge.h"
#endif
setup.h contains, in the two version of wxWidgets identical statements regarding webview:

Code: Select all

// Use wxWidget's web viewing classes
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEBVIEW 1

// Use the IE wxWebView backend
//
// Default is 1 on MSW
//
// Recommended setting: 1
#ifdef __WXMSW__
#define wxUSE_WEBVIEW_IE 1
#else
#define wxUSE_WEBVIEW_IE 0
#endif
It looks like somthing is missing. Any idea?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: 3.2.2.1 issue with webview

Post by ONEEYEMAN »

Hi,
Please check the name of the webview library and what is set in the Linker option of MSVC.

Thank you.
raananb
Super wx Problem Solver
Super wx Problem Solver
Posts: 488
Joined: Fri Oct 27, 2006 4:35 pm
Location: Paris, France
Contact:

Re: 3.2.2.1 issue with webview

Post by raananb »

webview.lib was not included in the link library. I added the library to both the Release and the Debug builds and things are back to normal.

This issue is odd, since the library was not explicitly included in the 3.2.1 build and there were no problems.

Thanks.
Post Reply