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.
-
sebs
- In need of some credit

- Posts: 8
- Joined: Mon Apr 02, 2018 3:56 pm
Post
by sebs » Mon Apr 02, 2018 4:11 pm
Hello everybody, as the title suggests, I am starting with wxWidgets.
I've been a couple of ours trying to build my wxWidgets 3.0.4 library and I just keep receiving the same error:
Code: Select all
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
^
makefile.gcc:5942: recipe for target 'gcc_mswu\wxtiff_tif_win32.o' failed
minGW32-make: *** [gcc_mswu\wxtiff_tif_win32.o] Error 1
The Path I'm working with is:
C:\wxWidgets-3.0.4\build\msw>
What is even stranger is that the 3.1.1 builds without any sort of problem but all the 3.0.x give me problems (I've tried with different releases).
I'm looking for the 3.0.x releases because I want to use Code:Blocks for a GUI development.
Thanks in advance.
-
PB
- Part Of The Furniture

- Posts: 2088
- Joined: Sun Jan 03, 2010 5:45 pm
Post
by PB » Mon Apr 02, 2018 4:40 pm
Unfortunately, the fix was not backported from 3.1 branch to 3.0 branch in time to make it into 3.04 release and was commited in 3.0 branch only recently:
https://github.com/wxWidgets/wxWidgets/ ... 144b0b7985
So the choices are clear, either use 3.1 branch or apply the simple patch from the commit above.
There is nothing that would prevent you using 3.1 branch with Code::Blocks. I do not use C:B myself, but when I needed it to test something with GCC, I used C:B to build the code and I did use wxWidgets 3.1.1 with no issues.
-
sebs
- In need of some credit

- Posts: 8
- Joined: Mon Apr 02, 2018 3:56 pm
Post
by sebs » Tue Apr 03, 2018 11:32 am
To be honest, I was looking forward to change to any 3.0.x library, as when I try to build my GUI it comes up with this error:
Code: Select all
||=== Build: Release in Prueba30 (compiler: GNU GCC Compiler) ===|
obj\Release\Prueba30App.o:Prueba30App.cpp|| undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'|
obj\Release\Prueba30App.o:Prueba30App.cpp|| undefined reference to `wxApp::wxApp()'|
obj\Release\Prueba30App.o:Prueba30App.cpp|| undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'|
obj\Release\Prueba30App.o:Prueba30App.cpp|| undefined reference to `wxAppConsoleBase::ms_appInstance'|
obj\Release\Prueba30App.o:Prueba30App.cpp|| undefined reference to `wxInitAllImageHandlers()'|
obj\Release\Prueba30App.o:Prueba30App.cpp|| undefined reference to `wxTopLevelWindowMSW::Show(bool)'|
obj\Release\Prueba30App.o:Prueba30App.cpp:(.text$_ZN11Prueba30AppD1Ev[__ZN11Prueba30AppD1Ev]+0xe)||undefined reference to `wxApp::~wxApp()'|
obj\Release\Prueba30App.o:Prueba30App.cpp:(.text$_ZN11Prueba30AppD0Ev[__ZN11Prueba30AppD0Ev]+0x14)||undefined reference to `wxApp::~wxApp()'|
obj\Release\Prueba30App.o:Prueba30App.cpp:(.text$_ZN12wxEvtHandler9TryParentER7wxEvent[__ZN12wxEvtHandler9TryParentER7wxEvent]+0x1)||undefined reference to `wxEvtHandler::DoTryApp(wxEvent&)'|
obj\Release\Prueba30App.o:Prueba30App.cpp:(.text$_ZN20wxObjectEventFunctorD1Ev[__ZN20wxObjectEventFunctorD1Ev]+0x7)||undefined reference to `wxEventFunctor::~wxEventFunctor()'|
And those amongst many others. I do not know why I get these errors, maybe it is just a very simple thing but I can not see it. I just think that the problema might be the fact that the 3.1.1 is not supported by code:blocks. If anyone knows how to solve it it would be of great help. I have been stuck for almost one day.
-
Manolo
- Can't get richer than this

- Posts: 704
- Joined: Mon Apr 30, 2012 11:07 pm
Post
by Manolo » Tue Apr 03, 2018 12:18 pm
It seems your linking command lacks some wx libraries, or you pass them in wrong order (GCC requirement).
Can you show the command used? If you do it from C::B, copy and paste from the "build log" tab in "logs" window.
-
sebs
- In need of some credit

- Posts: 8
- Joined: Mon Apr 02, 2018 3:56 pm
Post
by sebs » Wed Apr 04, 2018 4:38 pm
Sorry for the delay, I could not answer before, what I am compiling is:
Code: Select all
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.3\include -IC:\wxWidgets-3.0.3\lib\gcc_lib\mswu -c C:\Users\SEBASTIÁN\Documents\Universidad\TFG\PruebaThibault\PruebaThibaultApp.cpp -o obj\Release\PruebaThibaultApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.3\include -IC:\wxWidgets-3.0.3\lib\gcc_lib\mswu -c C:\Users\SEBASTIÁN\Documents\Universidad\TFG\PruebaThibault\PruebaThibaultMain.cpp -o obj\Release\PruebaThibaultMain.o
windres.exe -IC:\wxWidgets-3.0.3\include -IC:\wxWidgets-3.0.3\lib\gcc_lib\mswu -J rc -O coff -i C:\Users\SEBAST~1\DOCUME~1\UNIVER~1\TFG\PRUEBA~3\resource.rc -o obj\Release\resource.res
mingw32-g++.exe -LC:\wxWidgets-3.0.3\lib\gcc_lib -o bin\Release\PruebaThibault.exe obj\Release\PruebaThibaultApp.o obj\Release\PruebaThibaultMain.o obj\Release\resource.res -s -mthreads -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
and then all the errors start:
Code: Select all
obj\Release\PruebaThibaultApp.o:PruebaThibaultApp.cpp:(.text+0x15): undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'
obj\Release\PruebaThibaultApp.o:PruebaThibaultApp.cpp:(.text+0x2a): undefined reference to `wxApp::wxApp()'
-
PB
- Part Of The Furniture

- Posts: 2088
- Joined: Sun Jan 03, 2010 5:45 pm
Post
by PB » Wed Apr 04, 2018 5:55 pm
The folder and file names in the build log above indicate that it is wxWidgets 3.03, which will not build with newer (post GCC 5.3) MinGW without the patch from above? So where did the wxWidgets library you are trying to link with came from? Do you use exactly same compiler wxWidgets were built with for your project (it is a must)?
For the record, here is the build log from wxWidgets 3.1 application created with C::B 17.12 wizard compiled with MinGW-w64 i686-7.2.0-posix-dwarf-rt_v5-rev1
Code: Select all
-------------- Build: Release in wx31test (compiler: GNU GCC Compiler)---------------
windres.exe -IL:\Dev\Desktop\Lib\wxWidgets-GIT\include -IL:\Dev\Desktop\Lib\wxWidgets-GIT\lib\gcc_lib\mswu -J rc -O coff -i F:\Dev\Desktop\!MyProgs\wx31test\resource.rc -o obj\Release\resource.res
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -IL:\Dev\Desktop\Lib\wxWidgets-GIT\include -IL:\Dev\Desktop\Lib\wxWidgets-GIT\lib\gcc_lib\mswu -c F:\Dev\Desktop\!MyProgs\wx31test\wx31testApp.cpp -o obj\Release\wx31testApp.o
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -IL:\Dev\Desktop\Lib\wxWidgets-GIT\include -IL:\Dev\Desktop\Lib\wxWidgets-GIT\lib\gcc_lib\mswu -c F:\Dev\Desktop\!MyProgs\wx31test\wx31testMain.cpp -o obj\Release\wx31testMain.o
i686-w64-mingw32-g++.exe -LL:\Dev\Desktop\Lib\wxWidgets-GIT\lib\gcc_lib -o bin\Release\wx31test.exe obj\Release\wx31testApp.o obj\Release\wx31testMain.o obj\Release\resource.res -s -mthreads -lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lwxjpeg -lwxtiff -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -luxtheme -loleacc -mwindows
Output file is bin\Release\wx31test.exe with size 6.49 MB
I needed to manually add windows theme and accessibility libraries (liboleacc and libuxtheme), these two were not needed for 3.0 IIRC.
Edit: I only now realized you are using a monolithic build, my build log is using the default multilib wxWidgets build.
-
sebs
- In need of some credit

- Posts: 8
- Joined: Mon Apr 02, 2018 3:56 pm
Post
by sebs » Thu Apr 05, 2018 4:03 pm
You were right, I had compiled the libraries with tdm and the code blocks with another one. Now, I have changed it and the errors are new ones. So, what I have done is to re-install code blocks to its newest version and put all the compilers the same and work with 3.1.1 (sorry for so many changes I was just desperate). Right now I get these errors:
Code: Select all
x86_64-w64-mingw32-g++.exe -LC:\wxWidgets-3.1.1\lib\gcc_lib -o bin\Release\Pruebafinal.exe obj\Release\PruebafinalApp.o obj\Release\PruebafinalMain.o obj\Release\resource.res -s -mthreads ..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a ..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxpng.a ..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxjpeg.a ..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxtiff.a ..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxzlib.a -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0xe26c): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0xe28d): undefined reference to `__imp_GetThemeColor'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0xe302): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0xe9ae): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0xea47): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x10f59): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x10fd1): undefined reference to `__imp_GetThemeBackgroundContentRect'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11034): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11c1a): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11ca8): undefined reference to `__imp_GetThemeBackgroundContentRect'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11cfd): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11d18): undefined reference to `__imp_DrawThemeParentBackground'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11d4f): undefined reference to `__imp_DrawThemeBackground'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x11d7c): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x121b0): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_window.o):window.cpp:(.text+0x1231e): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x536): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x551): undefined reference to `__imp_GetThemeSysColor'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x58e): undefined reference to `__imp_GetThemeSysColor'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x5d1): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x64d): undefined reference to `__imp_GetThemeSysColor'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x6d4): undefined reference to `__imp_GetThemeSysColor'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x742): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x1f72): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x1fa0): undefined reference to `__imp_GetThemeMargins'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x2079): undefined reference to `__imp_GetThemePartSize'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x20ef): undefined reference to `__imp_GetThemeInt'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x2117): undefined reference to `__imp_GetThemeSysFont'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x2245): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x228f): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x2d0d): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x2d60): undefined reference to `__imp_DrawThemeBackground'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x2df3): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x3047): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x3d7b): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x3d8f): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x3d9e): undefined reference to `__imp_DrawThemeBackground'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x3e0d): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x4158): undefined reference to `__imp_DrawThemeBackground'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x41c4): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_menuitem.o):menuitem.cpp:(.text+0x447b): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_msw_statbox.o):statbox.cpp:(.text+0x24f0): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_msw_statbox.o):statbox.cpp:(.text+0x251d): undefined reference to `__imp_GetThemeFont'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_msw_statbox.o):statbox.cpp:(.text+0x2539): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_msw_statbox.o):statbox.cpp:(.text+0x25af): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_statusbar.o):statusbar.cpp:(.text+0x1b73): undefined reference to `__imp_OpenThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_statusbar.o):statusbar.cpp:(.text+0x1bb1): undefined reference to `__imp_GetThemeBackgroundContentRect'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_statusbar.o):statusbar.cpp:(.text+0x1bf0): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_statusbar.o):statusbar.cpp:(.text+0x1e28): undefined reference to `__imp_CloseThemeData'
..\..\..\..\..\..\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u.a(monolib_renderer.o):renderer.cpp:(.text+0x4dd): undefined reference to `__imp_OpenThemeData'
For the record, teh fact that there are so many \..\..\ is because I have added the path manually, which is just a C:\wxWidgets-3.1.1\lib\gcc_lib\.
Sorry for the inconvenience, it is just that I am quite desperate to get it working so I can at least compile something. Thanks in advance.
-
doublemax
- Moderator

- Posts: 14285
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
Post
by doublemax » Thu Apr 05, 2018 4:10 pm
These are all Windows functions inside UxTheme.lib. Add that library (the exact name could be different for MinGW).
Use the source, Luke!
-
PB
- Part Of The Furniture

- Posts: 2088
- Joined: Sun Jan 03, 2010 5:45 pm
Post
by PB » Thu Apr 05, 2018 5:09 pm
doublemax wrote:These are all Windows functions inside UxTheme.lib. Add that library (the exact name could be different for MinGW).
The need to add this library and its name are actually in my previous post. As written there, you may also need to add another windows library...
-
sebs
- In need of some credit

- Posts: 8
- Joined: Mon Apr 02, 2018 3:56 pm
Post
by sebs » Thu Apr 05, 2018 7:04 pm
-
ONEEYEMAN
- Part Of The Furniture

- Posts: 3580
- Joined: Sat Apr 16, 2005 7:22 am
- Location: USA, Ukraine
Post
by ONEEYEMAN » Thu Apr 05, 2018 8:59 pm
Hi,
Now try to build "minimal" sample - this will assure that the build works.
Thank you.