The sample "wxWidgets app" application can't be compiled smoothly  [SOLVED]

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.
dqf88
Knows some wx things
Knows some wx things
Posts: 47
Joined: Fri Aug 10, 2012 9:59 am

The sample "wxWidgets app" application can't be compiled smoothly

Postby dqf88 » Thu Mar 08, 2018 6:18 am

I can't compile the sample application "wxWidgets app" using wxwidgets3.1.1 and codeblocks17.12, but there is no error using wxwidgets3.1.0 and codeblocks17.12, why ?

Code: Select all


-------------- Build: Release in SS (compiler: GNU GCC Compiler)---------------

windres.exe -IC:\wxWidgets-3.1.1\include -IC:\wxWidgets-3.1.1\lib\gcc_lib\mswu  -J rc -O coff -i C:\Users\lenovo\Desktop\SS\resource.rc -o obj\Release\resource.res
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.1.1\include -IC:\wxWidgets-3.1.1\lib\gcc_lib\mswu -c C:\Users\lenovo\Desktop\SS\SSApp.cpp -o obj\Release\SSApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.1.1\include -IC:\wxWidgets-3.1.1\lib\gcc_lib\mswu -c C:\Users\lenovo\Desktop\SS\SSMain.cpp -o obj\Release\SSMain.o
mingw32-g++.exe -LC:\wxWidgets-3.1.1\lib\gcc_lib -o bin\Release\SS.exe  obj\Release\SSApp.o obj\Release\SSMain.o obj\Release\resource.res -s -mthreads  -lwxmsw31u_core -lwxbase31u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x11c2e): undefined reference to `OpenThemeData@8'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x11c6d): undefined reference to `GetThemeColor@20'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x11d2b): undefined reference to `CloseThemeData@4'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x124bb): undefined reference to `CloseThemeData@4'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x12572): undefined reference to `CloseThemeData@4'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x147f2): undefined reference to `OpenThemeData@8'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x14895): undefined reference to `GetThemeBackgroundContentRect@24'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x14936): undefined reference to `CloseThemeData@4'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15763): undefined reference to `LresultFromObject@12'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15d27): undefined reference to `OpenThemeData@8'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15e03): undefined reference to `GetThemeBackgroundContentRect@24'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15e84): undefined reference to `IsThemeBackgroundPartiallyTransparent@12'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15ec3): undefined reference to `DrawThemeParentBackground@12'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15f2b): undefined reference to `DrawThemeBackground@24'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x15f73): undefined reference to `CloseThemeData@4'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x163ab): undefined reference to `CloseThemeData@4'
C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x163ff): undefined reference to `CloseThemeData@4'
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: C:\wxWidgets-3.1.1\lib\gcc_lib/libwxmsw31u_core.a(corelib_window.o): bad reloc address 0x94 in section `.rdata'
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 13 second(s))
18 error(s), 0 warning(s) (0 minute(s), 13 second(s))

New Pagodi
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 246
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: The sample "wxWidgets app" application can't be compiled smoothly

Postby New Pagodi » Thu Mar 08, 2018 7:05 am

For 3.1.1, you'll need to add libuxtheme.a and liboleacc.a to the list of libraries that you're application links with.

dqf88
Knows some wx things
Knows some wx things
Posts: 47
Joined: Fri Aug 10, 2012 9:59 am

Re: The sample "wxWidgets app" application can't be compiled smoothly

Postby dqf88 » Thu Mar 08, 2018 8:17 am

I can't find these two libraries after compiling the wxwidgets3.1.1

New Pagodi
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 246
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: The sample "wxWidgets app" application can't be compiled smoothly  [SOLVED]

Postby New Pagodi » Thu Mar 08, 2018 9:02 am

They're part of the minGW libraries. The best place to add them is to the project libraries like so:

Untitled.png
Untitled.png (20.43 KiB) Viewed 268 times

dqf88
Knows some wx things
Knows some wx things
Posts: 47
Joined: Fri Aug 10, 2012 9:59 am

Re: The sample "wxWidgets app" application can't be compiled smoothly

Postby dqf88 » Fri Mar 09, 2018 12:16 am

Thanks, the libraries requested are in the "MinGW\lib" folder


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 5 guests