vs2019 wxwidgets示例Hello World->“未找到wxstrcoll”

时间:2020-07-10 05:16:54

标签: wxwidgets

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

遵循确切的说明,下载预编译的库,v 3.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:\work\wxwin\include\wx\wxcrt.h(487): error C3861: 'wxStrcoll': identifier not found
1>c:\work\wxwin\include\wx\wxcrt.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:\work\wxwin\include\wx\wxcrt.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 ==========

1 个答案:

答案 0 :(得分:2)

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

FWIW在wx 3.1中已经解决了很长时间(〜6年),并且您可以使用MSVS 2019编译3.1.3或即将发布的3.1.4来解决此问题。