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.
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:
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.
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.
||=== 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.
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.
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
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:
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.
Yes!!!! It has worked, I had to add the dynamic library (don't know why I had chosen the static option). Now it runs perfectly, thank you very much guys. Hope I don't have more problems for the next days