4

我一直在尝试使用 MinGW 的 GCC(版本 4.8.1)编译 wxWidgets,并且一直收到来自 g++ 的错误,说:

../../src/msw/treectrl.cpp: In member function 'virtual bool wxTreeCtrl::MSWOnNo
tify(int, WXLPARAM, WXLPARAM*)':
../../src/msw/treectrl.cpp:2581:17: error: 'NMTVDISPINFOWW' was not declared in
this scope
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                 ^
../../src/msw/treectrl.cpp:2581:30: error: 'info' was not declared in this scope

                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                              ^
../../src/msw/treectrl.cpp:2581:51: error: expected primary-expression before ')
' token
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                               ^
../../src/msw/treectrl.cpp:2581:52: error: expected ';' before 'lParam'
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                                ^
In file included from ..\..\include/wx/msw/gccpriv.h:22:0,
                 from ..\..\include/wx/platform.h:577,
                 from ..\..\include/wx/defs.h:21,
                 from ..\..\include/wx/wxprec.h:13,
                 from ../../src/msw/treectrl.cpp:21:
../../src/msw/treectrl.cpp:2615:17: error: 'NMTVDISPINFOWW' was not declared in
this scope
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                 ^
../../src/msw/treectrl.cpp:2615:30: error: 'info' was not declared in this scope

                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                              ^
../../src/msw/treectrl.cpp:2615:51: error: expected primary-expression before ')
' token
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                               ^
../../src/msw/treectrl.cpp:2615:52: error: expected ';' before 'lParam'
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                                ^
In file included from ..\..\include/wx/msw/gccpriv.h:22:0,
                 from ..\..\include/wx/platform.h:577,
                 from ..\..\include/wx/defs.h:21,
                 from ..\..\include/wx/wxprec.h:13,
                 from ../../src/msw/treectrl.cpp:21:
../../src/msw/treectrl.cpp:2659:17: error: 'NMTVDISPINFOWW' was not declared in
this scope
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                 ^
../../src/msw/treectrl.cpp:2659:30: error: 'info' was not declared in this scope

                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                              ^
../../src/msw/treectrl.cpp:2659:51: error: expected primary-expression before ')
' token
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                                   ^
../../src/msw/treectrl.cpp:2659:52: error: expected ';' before 'lParam'
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                                    ^
In file included from ..\..\include/wx/msw/gccpriv.h:22:0,
                 from ..\..\include/wx/platform.h:577,
                 from ..\..\include/wx/defs.h:21,
                 from ..\..\include/wx/wxprec.h:13,
                 from ../../src/msw/treectrl.cpp:21:
../../src/msw/treectrl.cpp:3084:17: error: 'NMTVDISPINFOWW' was not declared in
this scope
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                 ^
../../src/msw/treectrl.cpp:3084:30: error: 'info' was not declared in this scope

                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                  ^
../../src/msw/treectrl.cpp:3084:51: error: expected primary-expression before ')
' token
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                                   ^
../../src/msw/treectrl.cpp:3084:52: error: expected ';' before 'lParam'
                 TV_DISPINFO *info = (TV_DISPINFO *)lParam;
                                                    ^
makefile.gcc:9310: recipe for target 'gcc_mswudll\coredll_treectrl.o' failed
mingw32-make: *** [gcc_mswudll\coredll_treectrl.o] Error 1

谁能帮忙,我试过谷歌搜索,但结果很少(是的,我确实读过它们!)。

4

2 回答 2

7

您的标题中似乎有一个错误,NMTVDISPINFOWW(带有 2 个尾随 Ws)不存在,也不应该出现在任何地方。您可以尝试自行修复标头中的拼写错误,或下载适用于 Windows 的 gcc 发行版(例如 MinGW-w64 或 TDM-GCC)。

于 2013-10-20T11:46:58.980 回答
4

此处记录了一个类似的问题:http: //mingw.5.n7.nabble.com/win32api-version-4-td32288.html
无论如何,我强烈建议使用 MinGW-w64 或 TDM-GCC 的 sjlj 版本。
“标准” MinGW Distribution 使用 dw2 异常处理,当异常通过事件循环时会导致一些问题。

于 2013-10-23T07:26:53.993 回答