本文介绍了使用GCC-4.8.1在MinGW上编译wxWidgets-2.8.12时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在试着用MinGW的GCC(版本4.8.1)编译wxWidgets,并且一直从g ++接收错误,并说:
您的头文件中似乎有一个错误, NMTVDISPINFOWW (带有2个尾随的W)不存在,并且不应该出现在任何地方。您可以尝试修复头文件中的拼写错误或下载已知可用的Windows版gcc(例如MinGW-w64或TDM-GCC)。
I've been trying to compile wxWidgets with MinGW's GCC (version 4.8.1), and have been receiving errors from g++, saying:
../../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 1Can anyone help, I've tried googling, but with minimal results (and yes I did read them!).
解决方案You seem to have a bug in your headers, NMTVDISPINFOWW (with 2 trailing Ws) doesn't exist and shouldn't appear anywhere. You can try fixing the typo in the headers themselves or downloading a distribution of gcc for Windows known to work (such as MinGW-w64 or TDM-GCC).
这篇关于使用GCC-4.8.1在MinGW上编译wxWidgets-2.8.12时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!