Opened 13 months ago

Closed 11 months ago

Last modified 3 months ago

#15537 closed build error (invalid)

error in compiling wxwidgets 2.8.12/3.0.0 with windows+mingw (4.8.1 64bit)

Reported by: wally67 Owned by:
Priority: critical Milestone:
Component: build Version: 3.0.0
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

hi there

i downloaded 2.8.12 wxwidgets release and mingw (installer rev sep-10-13)
trying to compile wxwidgets with gcc i obtain the followionf error report

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:2616:17: error: 'NMTVDISPINFOAA' was not declared in this scope

TV_DISPINFO *info = (TV_DISPINFO *)lParam;

../../src/msw/treectrl.cpp:2616:30: error: 'info' was not declared in this scope

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


../../src/msw/treectrl.cpp:2616:51: error: expected primary-expression before ') ' token

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


../../src/msw/treectrl.cpp:2616: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:2660:17: error: 'NMTVDISPINFOAA' was not declared in this scope

TV_DISPINFO *info = (TV_DISPINFO *)lParam;

../../src/msw/treectrl.cpp:2660:30: error: 'info' was not declared in this scope

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


../../src/msw/treectrl.cpp:2660:51: error: expected primary-expression before ') ' token

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


../../src/msw/treectrl.cpp:2660: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:3085:17: error: 'NMTVDISPINFOAA' was not declared in this scope

TV_DISPINFO *info = (TV_DISPINFO *)lParam;

../../src/msw/treectrl.cpp:3085:30: error: 'info' was not declared in this scope

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


../../src/msw/treectrl.cpp:3085:51: error: expected primary-expression before ') ' token

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


../../src/msw/treectrl.cpp:3085:52: error: expected ';' before 'lParam'

TV_DISPINFO *info = (TV_DISPINFO *)lParam;


makefile.gcc:10490: recipe for target 'gcc_mswd\corelib_treectrl.o' failed
mingw32-make: * [gcc_mswd\corelib_treectrl.o] Error 1

and i'm not able to correct it

p.s.
it's my first ticket here, so i apologize about errors if present

Change History (9)

comment:1 follow-up: Changed 13 months ago by vadz

If you're just starting with wxWidgets, please use 2.9.5 instead. It should compile out of the box for you.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 13 months ago by wally67

Replying to vadz:

If you're just starting with wxWidgets, please use 2.9.5 instead. It should compile out of the box for you.

i just made it also for 2.9.5 and i obtained the same result

comment:3 in reply to: ↑ 2 Changed 13 months ago by wally67

Replying to wally67:

i just made it also for 2.9.5 and i obtained the same result

additional infos
i cam compile both releases without errors if i use MinGW 2011-11-18 release

comment:4 follow-up: Changed 13 months ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed

Looking at the errors more carefully, I see a very strange NMTVDISPINFOAA symbol appearing in them. It definitely doesn't occur in our sources so it must be some mistake in MinGW headers you used. I wasn't aware of any version of MinGW with this symbol in its headers, so perhaps your installation was somehow corrupted locally. In any case, there is not much we can do about it and if it works with a later release, all the better.

And, finally, we recommend MinGW-w64 for building wxWidgets as it includes a lot more SDK functionality and is generally newer and compiles faster.

comment:5 in reply to: ↑ 4 Changed 11 months ago by stefan_g

  • Priority changed from blocker to critical
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Summary changed from error in compiling wxwidgets 2.8.12 with windows+mingw to error in compiling wxwidgets 2.8.12/3.0.0 with windows+mingw (4.8.1 64bit)
  • Version changed from 2.8.x to 3.0.0

Hello Vadim and others.

Replying to vadz:

in "bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)"
in the TVN_BEGINLABELEDIT branch of "switch",

  1. TV_DISPINFO is expanded by #define TV_DISPINFO __AW(NMTVDISPINFO) in MinGW's "/include/commctrl.h"
  1. the __AW(AW) preprocessor macro is defined in MinGW's "/include/_mingw.h":

__AW(AW) __AW__(AW, A) for ANSI -> "__AW__(NMTVDISPINFO,A)"

  1. __AW__(AW, A) is defined as "#define __AW__(AW, AW_) AW ## AW_"  in MinGW's "/include/_mingw.h"
  1. I think "TV_DISPINFO" was intended to become "NMTVDISPINFOA" but in fact it gets the "A" suffix twice

This double "A" seems to cause the error. But what is the reason for this?

It seems to be related with these 2 lines in MinGW's "/include/commctrl.h":

"#define NMTVDISPINFO __AW(NMTVDISPINFO)" is defined above
"#define TV_DISPINFO __AW(NMTVDISPINFO)". So NMTVDISPINFO gets NMTVDISPINFOA which in turn gets NMTVDISPINFOAA ?!

I changed "TV_DISPINFO" to "NMTVDISPINFO" in
"../../src/msw/treectrl.cpp". Now it built the wxbase30u_gcc_custom.dll and wxbase30u_net_gcc_custom.dll!


Unfortunately My eclipse CDT doesn't show me "macro expansion" for "TV_DISPINFO".

What do you mean by "MinGW-w64"? Could you explain how to install it?

Thanks in advance!

bye, Stefan

Looking at the errors more carefully, I see a very strange NMTVDISPINFOAA symbol appearing in them. It definitely doesn't occur in our sources so it must be some mistake in MinGW headers you used. I wasn't aware of any version of MinGW with this symbol in its headers, so perhaps your installation was somehow corrupted locally. In any case, there is not much we can do about it and if it works with a later release, all the better. And, finally, we recommend MinGW-w64 for building wxWidgets as it includes a lot more SDK functionality and is generally newer and compiles faster.

comment:6 follow-up: Changed 11 months ago by vadz

  • Resolution set to invalid
  • Status changed from reopened to closed

As I said, this is clearly a bug in MinGW headers, so there is really nothing we can do about this.

As for MinGW-w64, it's really, really easy to find its home page: it's the first match in web search for it, please see there for more information.

comment:7 in reply to: ↑ 6 Changed 4 months ago by PietTheElder

Replying to vadz:

As I said, this is clearly a bug in MinGW headers, so there is really nothing we can do about this.

As for MinGW-w64, it's really, really easy to find its home page: it's the first match in web search for it, please see there for more information.

It is a change to the Microsoft OS "Tree-View Control":

http://msdn.microsoft.com/en-us/library/windows/desktop/bb773418(v=vs.85).aspx

To quote the link:

"NMTVDISPINFO structure
Contains and receives display information for a tree-view item. This structure is identical to the TV_DISPINFO structure, but it has been renamed to follow current naming conventions."

comment:8 Changed 3 months ago by VZ

In 77048:

Use NMTVDISPINFO instead of TV_DISPINFO in wxMSW code.

The latest w32api 4.0.3, used by MinGW project, still didn't manage to apply a
one line fix to define TV_DISPINFO correctly, so tweak our sources to avoid
using it.

See #15537.

comment:9 Changed 3 months ago by VZ

In 77050:

Use NMTVDISPINFO instead of TV_DISPINFO in wxMSW code.

The latest w32api 4.0.3, used by MinGW project, still didn't manage to apply a
one line fix to define TV_DISPINFO correctly, so tweak our sources to avoid
using it.

See #15537.

Note: See TracTickets for help on using tickets.