MinGW and wxAuiNotebook

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Gampy
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Oct 11, 2017 1:48 pm

MinGW and wxAuiNotebook

Post by Gampy »

Hi all,

Is there some sort of issue with wxAuiNotebook and GCC or is it me ...
It does work in msvc.

Stupid simple app, a frame and a sizer.
Statically linked.

wxWidgets 3.1.1 (git master) built with MinGW 5.3.0 like so ...

Code: Select all

mingw32-make -f makefile.gcc BUILD=debug SHARED=0 RUNTIME_LIBS=static UNICODE=1
So far have been able to use every object tried EXCEPT a wxAuiNotebook ...
Adding a wxAuiNotebook object to the project causes the following error:

Code: Select all

T:/wxWidgets/wxWidgets/lib/gcc_lib/libwxmsw31ud_aui.a(auilib_floatpane.o): In function `_static_initialization_and_destruction_0':
T:\wxWidgets\wxWidgets\build\msw/../../src/aui/floatpane.cpp:38: undefined reference to `wxMiniFrame::ms_classInfo'
T:/wxWidgets/wxWidgets/lib/gcc_lib/libwxmsw31ud_aui.a(auilib_floatpane.o): In function `ZN11wxMiniFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_':
T:\wxWidgets\wxWidgets\build\msw/../../include/wx/msw/minifram.h:42: undefined reference to `vtable for wxMiniFrame'
T:/wxWidgets/wxWidgets/lib/gcc_lib/libwxmsw31ud_aui.a(auilib_floatpane.o): In function `ZN11wxMiniFrameD2Ev':
T:\wxWidgets\wxWidgets\build\msw/../../include/wx/msw/minifram.h:16: undefined reference to `vtable for wxMiniFrame'
collect2.exe: error: ld returned 1 exit status
FMI ... Speak your needs, I'll do my best to oblige!

Thanks all
-Enjoy : )_~
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: MinGW and wxAuiNotebook

Post by doublemax »

Can you successfully build the "aui" sample that comes with wxWidgets? If yes, check which libraries it imports. It's possible that MSVC adds them automatically through #pragma's
Use the source, Luke!
Gampy
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Oct 11, 2017 1:48 pm

Re: MinGW and wxAuiNotebook

Post by Gampy »

Gotta admit I feel pretty stupid for not trying the aui example ... I swear it's an age thing!

However, thanks to your suggestion I have at least gotten my simple test app to link, still no success in my real app.

it's not a missing library issue, it's the order they are included ...

I did read about that, was not clearly explained, so that led to more confusion, I did try some different orders, obviously never got it right.

So how does one determine the required order?

Thanks
-Enjoy : )_~
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: MinGW and wxAuiNotebook

Post by PB »

Have you tried the order described in Step 6.1 here?

Obviously, you need to replace "29" with "31".

BTW, I believe that RUNTIME_LIBS is MSVC only and Unicode is the default mode since wx 2.9.

Edit The simplest way to determine the correct GCC lib order would be to use the provided GCC makefile for a sample. E.g., running mingw32-make -f makefile.gcc in the aui sample folder you get
l:\Dev\Desktop\wxWidgets-GIT\samples\aui>mingw32-make -f makefile.gcc
if not exist gcc_mswud mkdir gcc_mswud
windres --use-temp-file -i../../samples/sample.rc -ogcc_mswud\auidemo_sample_rc.o --define __WXMSW__ --define _UNICODE --include-dir .\..\..\lib\gcc_lib\mswud --include-dir ./../../include --include-dir . --include-dir ./../../samples --define NOPCH
g++ -c -o gcc_mswud\auidemo_auidemo.o -g -O0 -mthreads -DHAVE_W32API_H -D__WXMSW__ -D_UNICODE -I.\..\..\lib\gcc_lib\mswud -I.\..\..\include -W -Wall -I. -I.\..\..\samples -DNOPCH -Wno-ctor-dtor-privacy -MTgcc_mswud\auidemo_auidemo.o -MFgcc_mswud\auidemo_auidemo.o.d -MD -MP auidemo.cpp
g++ -o gcc_mswud\auidemo.exe gcc_mswud\auidemo_sample_rc.o gcc_mswud\auidemo_auidemo.o -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows -lwxmsw31ud_aui -lwxmsw31ud_html -lwxmsw31ud_adv -lwxmsw31ud_core -lwxbase31ud_xml -lwxbase31ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc
I believe that with GCC (MSVC does not care), you need to list the libraries in a "reverse order" they depend on each other. You can see wxWidgets library dependencies here: http://docs.wxwidgets.org/trunk/page_libs.html
Post Reply