VS2019 WXWIDGETS 示例 你好世界 -> "wxstrcoll not found"



似乎很多人都遇到了这个问题,但我似乎找不到解决方案。

按照确切的说明,下载预编译的libs,v3.0.5-最新的稳定构建

set wxwin env var
make new 32bit empty project
copy the hello world app into new source file
set additional include
set preproc defintions -> UNICODE & _UNICODE on
set linker libs

构建->

1>------ Build started: Project: wxtest, Configuration: Debug Win32 ------
1>Source.cpp
1>c:workwxwinincludewxwxcrt.h(487): error C3861: 'wxStrcoll': identifier not found
1>c:workwxwinincludewxwxcrt.h(487): message : 'wxStrcoll': function was not declared in the template definition context and can be found only via argument-dependent lookup in the instantiation context
1>c:workwxwinincludewxwxcrt.h(496): message : see reference to function template instantiation 'int wxStrcoll_String<const wchar_t*>(const wxString &,const T &)' being compiled
1>        with
1>        [
1>            T=const wchar_t *
1>        ]
1>Done building project "wxtest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

不幸的是,您需要手动修改标头以修复3.0.5中MSVS 2019的构建,并删除wx/wxcrt.hwxNEEDS_DECL_BEFORE_TEMPLATE定义之前的defined(__VISUALC__) ||部分检查。

FWIW这个问题在wx 3.1中已经解决了很长一段时间(约6年(,您可以使用MSVS 2019开箱即用地编译3.1.3或即将发布的3.1.4。

最新更新