Erreur lors de la compilation de wxWidgets-2.8.12 sur MinGW avec GCC-4.8.1

J’ai essayé de comstackr wxWidgets avec GCC (version 4.8.1) de MinGW et j’ai reçu des erreurs de g ++ en disant:

../../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 

Quelqu’un peut-il aider, j’ai essayé de googler, mais avec des résultats minimes (et oui, je les ai lus!).

Vous semblez avoir un bug dans vos en-têtes, NMTVDISPINFOWW (avec 2 NMTVDISPINFOWW de fin) n’existe pas et ne doit apparaître nulle part. Vous pouvez essayer de corriger la faute de frappe dans les en-têtes eux-mêmes ou de télécharger une dissortingbution de gcc pour Windows connue pour fonctionner (telle que MinGW-w64 ou TDM-GCC).

Un problème similaire est documenté ici: http://mingw.5.n7.nabble.com/win32api-version-4-td32288.html
Quoi qu’il en soit, je conseillerais fortement d’utiliser une version sjlj de MinGW-w64 ou TDM-GCC.
La dissortingbution MinGW “standard” utilise la gestion des exceptions dw2, ce qui pose certains problèmes lorsque des exceptions sont transmises via le eventloop.