Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13645 closed defect (fixed)

Latest mingw compile with latest wxWidgets svn on 111109

Reported by: msbroadf Owned by:
Priority: normal Milestone: 2.9.3
Component: wxMSW Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

include/wx/msw/missing.h line 522 that struct is defined already in mingw now

Attachments (2)

missing.patch download (1.9 KB) - added by markdootson 7 years ago.
webview.patch download (14.3 KB) - added by markdootson 7 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 years ago by vadz

  • Status changed from new to infoneeded_new

What is the version of MinGW that you use? We need to know it to be able to test for this somehow...

comment:2 Changed 7 years ago by msbroadf

  • Status changed from infoneeded_new to new

Hi, mingw 4.6.1

comment:3 Changed 7 years ago by markdootson

The definitions have been part of mingw-w64 for some time (my 4.4.6 with their v1 crt has them), but are not yet in mingw.org. They are in exdisp.h if present.

Seems the fix would be to move the typedef down to the section for webview in missing.h so it is within

#if defined(MINGW32) && !defined(MINGW64_VERSION_MAJOR)

after _ming.h has been included.

This fixes my mingw-w64.

comment:4 Changed 7 years ago by markdootson

There are other issues with current svn so I'll test against mingw-w64 and mingw.org and submit tested patches.

Changed 7 years ago by markdootson

comment:5 Changed 7 years ago by markdootson

with missing.patch trunk rev 69740 builds ok with

current mingw.org 32 bit
mingw-w64 32 bit
mingw-w64 64 bit

comment:6 follow-up: Changed 7 years ago by vadz

Thanks Mark, I'll apply the patch but I still can't build webview library with mingw32 cross-compiler (4.2.1-sjlj) because of:

webviewdll_webview_ie.o:webview_ie.cpp:(.text+0xbdf): undefined reference to `_IID_IInternetProtocolRoot'
webviewdll_webview_ie.o:webview_ie.cpp:(.text+0xbf6): undefined reference to `_IID_IInternetProtocol'
collect2: ld returned 1 exit status

And indeed, while we do have DEFINE_GUID for those in wx/msw/missing.h we don't seem to define INITGUID anywhere. So shouldn't we really define these GUIDs ourselves too or would this result in problems when they're indeed present in the libraries? In the latter case we could add a configure test for this.

comment:7 Changed 7 years ago by VZ

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

(In [69757]) Don't redefine symbols already defined in latest MinGW headers.

Closes #13645.

comment:8 in reply to: ↑ 6 Changed 7 years ago by markdootson

Replying to vadz:

Thanks Mark, I'll apply the patch but I still can't build webview library with mingw32 cross-compiler (4.2.1-sjlj) because of:

webviewdll_webview_ie.o:webview_ie.cpp:(.text+0xbdf): undefined reference to `_IID_IInternetProtocolRoot'
webviewdll_webview_ie.o:webview_ie.cpp:(.text+0xbf6): undefined reference to `_IID_IInternetProtocol'
collect2: ld returned 1 exit status

And indeed, while we do have DEFINE_GUID for those in wx/msw/missing.h we don't seem to define INITGUID anywhere. So shouldn't we really define these GUIDs ourselves too or would this result in problems when they're indeed present in the libraries? In the latter case we could add a configure test for this.

You are right, we do need to 'initialise' the GUIDS.
A quick browse of http://support.microsoft.com/kb/130869 and then a look at the source for mingw.org and mingw-w64 shows me that the correct way to handle this is to #include initguid.h in the source where the GUIDS are defined and used.
For info, mingw-w64 includes the DECLSPEC_SELECTANY code that allows you to initialise a GUID multiple times whereas mingw.org does not. So to cope happily with both we should ensure that GUIDs are initialised only once.

I found that src/msw/textentry.cpp handles exactly this issue with an #include initguid.h and then defines the interface to be wxWidgets specific so that it can be used by all compilers.

Moving all the webview stuff from include/wx/msw/missing.h to src/msw/webview_ie.cpp and handling as in textentry.cpp seems the best way forward.

If you agree I'll do necessary and test + submit patch.

I can only assume that my original test build succeeded at all as I was building with gdiplus and INITGUID gets defined somewhere along the way.

comment:9 Changed 7 years ago by vadz

I found that src/msw/textentry.cpp handles exactly this issue with an #include initguid.h and then defines the interface to be wxWidgets specific so that it can be used by all compilers.

Right, I knew that this wasn't a new idea but forgot where exactly I already used it. And I agree that doing the same thing in webview_ie.cpp would be the best.

TIA!

comment:10 Changed 7 years ago by markdootson

  • Patch set

Attached webview.patch against svn r69767 tested with

mingw.org gcc 4.5.2
mingw-w64 gcc 4.6.2
MSVC 10

webview sample looks good in all cases.

Changed 7 years ago by markdootson

comment:11 Changed 7 years ago by VZ

(In [69768]) Move wxWebView-related definitions to webview_ie.cpp and fix them.

Ensure that all the GUIDs are defined by including initguid.h to fix linking
error with most versions of MinGW.

Use "wx" prefix to avoid clashes with the standard GUIDs if they do happen to
be defined.

Closes #13645.

Note: See TracTickets for help on using tickets.