Closed LesNewell-SheetCam closed 4 years ago
WARNING: Unable to find requested wxWidgets component : scintilla * wxWidgets requested but not found.
What happens if you ignore this warning? Can you include full cmake command and its output?
I just rebuilt using the latest wxlua master and wxwidgets 3.1.4 on Windows and don't see this warning, but I'm using mingw/msys.
If I ignore the warning it will generate solution files but they are missing links to the wx headers and libraries. If I manually add them to the projects I still end up with the same link errors. I'm using cmake-gui. I'll post the output tomorrow.
Also, can you try building from the command line instead of cmake-gui?
Here's the result of running cmake on the command line. Sorry about the formatting. I don't know why that is happening.
-- Using these wxWidgets components: stc;scintilla;webview;gl;xrc;xml;net;media;propgrid;richtext;aui;html;adv;core;base -- Could NOT find wxWidgets (missing: wxWidgets_FOUND) -- CMake Warning at build/CMakewxAppLib.cmake:325 (message):
-- - wxWidgets_VERSION = 3.1.4 = 3.1.4 -- - wxWidgets_COMPONENTS = stc;scintilla;webview;gl;xrc;xml;net;media;propgrid;richtext;aui;html;adv;core;base -- - wxWidgets_INCLUDE_DIRS = /wx-3.0/wxWidgets/lib/vc_dll/mswu;/wx-3.0/wxWidgets/include -- - wxWidgets_LIBRARY_DIRS = /wx-3.0/wxWidgets/lib/vc_dll -- - wxWidgets_LIBRARIES = debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_stc.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_stc.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_webview.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_webview.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_gl.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_gl.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_xrc.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_xrc.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxbase31ud_xml.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxbase31u_xml.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxbase31ud_net.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxbase31u_net.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_media.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_media.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_propgrid.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_propgrid.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_richtext.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_richtext.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_aui.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_aui.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_html.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_html.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_adv.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_adv.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31ud_core.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxmsw31u_core.lib;debug;/wx-3.0/wxWidgets/lib/vc_dll/wxbase31ud.lib;optimized;/wx-3.0/wxWidgets/lib/vc_dll/wxbase31u.lib;opengl32;glu32;winmm;comctl32;rpcrt4;wsock32 -- - wxWidgets_CXX_FLAGS = -- - wxWidgets_DEFINITIONS = WXUSINGDLL;UNICODE;_UNICODE -- - wxWidgets_DEFINITIONS_DEBUG = _DEBUG;WXDEBUG -- - wxWidgets_PORTNAME = -- - wxWidgets_UNIVNAME = -- - wxWidgets_UNICODEFLAG = -- - wxWidgets_DEBUGFLAG = WARNING: Unable to find requested wxWidgets component : scintilla -- wxWidgets requested but not found. -- wxLua using built-in Lua 5.1 library -- WARNING: cppcheck NOT found, NOT generating ADD_CPPCHECK_TEST() tests -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- WARNING: Doxygen NOT found, wxLua_doxygen target will not be generated. -- Configuring done -- Generating done -- Build files have been written to: C:/wx-3.0/wxlua/build
OK, most of the link errors seem to be specific to my slightly odd configuration which is needed to maintain XP compatibility. If I do the CMake hackery I get something that mostly builds.
I did find a problem in wxlstack.h:
WX_DECLARE_HASH_MAP_WITH_DECL( wxUIntPtr, wxUIntPtr, wxIntegerHash, wxIntegerEqual, wxUIntPtrToUIntPtrHashMap, class WXDLLIMPEXP_BASE );
I'm using shared wxWidgets and shared wxLua so WXDLLIMPEXP_BASE resolves to __declspec(dllimport). This results in a number of unresolved external symbols.
Just for testing I changed it to:
WX_DECLARE_HASH_MAP_WITH_DECL( wxUIntPtr, wxUIntPtr, wxIntegerHash, wxIntegerEqual, wxUIntPtrToUIntPtrHashMap, class);
I'll see if that causes problems when I get to reading the Lua stack.
-DwxWidgets_ROOT_DIR=/wx-3.0/wxWidgets
-- Could NOT find wxWidgets (missing: wxWidgets_FOUND) -- * CMake Warning at build/CMakewxAppLib.cmake:325 (message): WARNING: Could not find wxWidgets! Please see help above.
I'm not sure why the script would report that wxWidgets is not found; maybe try changing the ROOT reference to c:/wx-3.0/wxWidgets
or c:\wx-3.0\wxWidgets
.
I'll see if that causes problems when I get to reading the Lua stack.
I'm not sure what else to suggest, so if you get this resolved, please update the ticket with details. Thanks!
I tried changing to c:\wx-3.0\wxWidgets and it made no difference. It must be finding wxWidgets because you get this:
-- * - wxWidgets_VERSION = 3.1.4 = 3.1.4
Additionally if I remove the FindwxWidgets.cmake supplied with wxLua and use the one supplied with cMake it finds wxWidgets as it should.
Additionally if I remove the FindwxWidgets.cmake supplied with wxLua and use the one supplied with cMake it finds wxWidgets as it should.
I think this is correct. It probably comes down to the missing versions in the script. I updated the script, so expect it to work.
Thanks. I just tested it and it CMake now completes.
Did you have any thoughts on the problem in wxlstack.h?
I also found another anomaly. In wxWebview_bind.h, line 14:
#if not defined(wxUSE_WEBVIEW)
This generates a compiler warning. Should that not be:
#if !defined(wxUSE_WEBVIEW)
Did you have any thoughts on the problem in wxlstack.h? I'm using shared wxWidgets and shared wxLua so WXDLLIMPEXP_BASE resolves to __declspec(dllimport). This results in a number of unresolved external symbols.
I'm not sure why this is an issue, as I also use a shared wxWidgets build on Windows and have never had a problem (although I'm not using VS).
I'll see if that causes problems when I get to reading the Lua stack.
I read this as being related to the wxlstack.h issue and that you were going to see if this is a real issue or not.
I also found another anomaly. In wxWebview_bind.h, line 14:
if not defined(wxUSE_WEBVIEW)
This generates a compiler warning. Should that not be:
if !defined(wxUSE_WEBVIEW)
I think you are right, but I'll double check.
@sheetcam, fixed the check; thanks! Let me know if you figure out the wxlstack.h issue.
Well, WXDLLIMPEXP_BASE resolves to __declspec(dllimport). As wxUIntPtrToUIntPtrHashMap is not defined in any other libraries, there is an unresolved external.
I think this comes down to how the two compilers handle linking.
VC expects to be able to resolve all externals when you create a libary.
In my experience GCC does not worry too much about unresolved externals when creating libraries. It only fully checks when you link your final executable. If the executable does not use those externals you won't get any errors. I've been bitten by this before. My libraries appeared to build fine but I had problems linking the executable due to unresolved externals.
@sheetcam, I think this definition shouldn't have _WITH_DECL
suffix. Can you try this patch:
diff --git a/wxLua/modules/wxlua/debug/wxlstack.h b/wxLua/modules/wxlua/debug/wxlstack.h
index 13109c1..862a605 100644
--- a/wxLua/modules/wxlua/debug/wxlstack.h
+++ b/wxLua/modules/wxlua/debug/wxlstack.h
@@ -24,8 +24,8 @@ class WXDLLIMPEXP_FWD_CORE wxProgressDialog;
class WXDLLIMPEXP_FWD_WXLUADEBUG wxLuaDebugData;
-WX_DECLARE_HASH_MAP_WITH_DECL( wxUIntPtr, wxUIntPtr, wxIntegerHash, wxIntegerEqual,
- wxUIntPtrToUIntPtrHashMap, class WXDLLIMPEXP_BASE );
+WX_DECLARE_HASH_MAP( wxUIntPtr, wxUIntPtr, wxIntegerHash, wxIntegerEqual,
+ wxUIntPtrToUIntPtrHashMap, class WXDLLIMPEXP_BASE );
// ----------------------------------------------------------------------------
// wxWindowIds for the wxLuaStackDialog
Actually, this is a better diff:
diff --git a/wxLua/modules/wxlua/debug/wxlstack.h b/wxLua/modules/wxlua/debug/wxlstack.h
index 13109c1..51a6f18 100644
--- a/wxLua/modules/wxlua/debug/wxlstack.h
+++ b/wxLua/modules/wxlua/debug/wxlstack.h
@@ -24,8 +24,8 @@ class WXDLLIMPEXP_FWD_CORE wxProgressDialog;
class WXDLLIMPEXP_FWD_WXLUADEBUG wxLuaDebugData;
-WX_DECLARE_HASH_MAP_WITH_DECL( wxUIntPtr, wxUIntPtr, wxIntegerHash, wxIntegerEqual,
- wxUIntPtrToUIntPtrHashMap, class WXDLLIMPEXP_BASE );
+WX_DECLARE_HASH_MAP( wxUIntPtr, wxUIntPtr, wxIntegerHash, wxIntegerEqual,
+ wxUIntPtrToUIntPtrHashMap );
// ----------------------------------------------------------------------------
// wxWindowIds for the wxLuaStackDialog
Yup, that second diff works for me. Thank you.
Ok; pushed.
Win10 wxWidgets 3.1.4 Git master CMake 3.17.2 wxLua Git master
wxWidgets built multilib shared using VS2019. Samples compile and run.
Run CMake on wxLua and I get this error: ` WARNING: Unable to find requested wxWidgets component : scintilla
wxWidgets requested but not found.
wx3.1.4 doesn't have scintilla as a separate library so that's to be expected. I commented out line 248 of CMakewxAppLib.cmake to stop it forcing a search for scintilla:
#set(wxWidgets_COMPONENTS "stc" "scintilla" ${wxWidgets_COMPONENTS}) `I now get: `CMake Warning at build/CMakewxAppLib.cmake:325 (message):
It is obviously finding wx because the version numbers show correctly and the wxWidgets paths are correct. This looks like the custom FindwxWidgets.cmake is unhappy so I removed it, allowing CMake to fall back to it's own FindwxWidgets.cmake.
Now after this hackery CMake is happy, generating a VS solution. The files compile but won't link. I get loads of unresolved externals:
4>luamodule.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxApp::sm_eventTable" (?sm_eventTable@wxApp@@1UwxEventTable@@B) 4>wxllua.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlobject.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlstate.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlua_bind.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlstack.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlbind.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlcallb.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlconsole.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxldserv.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxldtarg.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxlsock.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxldebug.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxbase_bind.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxbase_data.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA) 4>wxbase_datetime.obj : error LNK2001: unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA)
I checked and the linker has the paths to the correct wxWidgets libraries.