Error creating project in CodeBlocks

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
tap1956
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Mar 05, 2020 8:05 pm

Error creating project in CodeBlocks

Post by tap1956 »

Windows 7 Home 32 bit. I configured CodeBlocks and wxWidgets according to the instructions in 1_Installation Instructions.docx. The minimal.exe program was created from command line and was runed normal. I tried to make a frame based project according to 2_Create_Minimal.cpp_In_CodeBlocks.docx. There were a lot of mistakes. Here is a piece from the error message:
C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31ud_core.a(corelib_window.o): In function `ZN8wxWindow16MSWHandleMessageEPljjl':
c:\wxWidgets-3.1.3\build\msw/../../src/msw/window.cpp:3568: undefined reference to `IID_IAccessible'
c:\wxWidgets-3.1.3\build\msw/../../src/msw/window.cpp:3568: undefined reference to `LresultFromObject@12'
c:\wxWidgets-3.1.3\build\msw/../../src/msw/window.cpp:3769: undefined reference to `GetThemeBackgroundContentRect@24'
c:\wxWidgets-3.1.3\build\msw/../../src/msw/window.cpp:3818: undefined reference to `GetThemeBackgroundContentRect@24'
c:\wxWidgets-3.1.3\build\msw/../../src/msw/window.cpp:3839: undefined reference to `IsThemeBackgroundPartiallyTransparent@12'
c:\wxWidgets-3.1.3\build\msw/../../src/msw/window.cpp:3841: undefined reference to `DrawThemeParentBackground@12'
...........................
What am I doing wrong?
Attachments
FrameBuilder.zip
(6.42 KiB) Downloaded 69 times
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error creating project in CodeBlocks

Post by PB »

Add libraries uxtheme and oleacc to the linker settings where you have other windows system libraries.
tap1956
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Mar 05, 2020 8:05 pm

Re: Error creating project in CodeBlocks

Post by tap1956 »

Thank you very much, everything worked out. I added libraries libuxtheme.a liboleacc.a libwxjpeg.a libwxtiff.a in Project's build option in Linker settings. For the future I would like to know, how can I find out what other library I need to add from the error message?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error creating project in CodeBlocks

Post by PB »

For wxWidgets, a documentation for a class always has a "Library: " section where you can see which library the class belongs to. In the wxWidgets library scheme you can see which library depends on which. The image format libraries are not listed there, just notice that some of them require wxzlib library.

Please notice that with MinGW, the order you list the libraries to link with matters: if library A depends on library B, library B needs to be listed first.


For system Windows libraries, the best and fastest way may be just to google the error message. But you probably have all you need listed already.
tap1956
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Mar 05, 2020 8:05 pm

Re: Error creating project in CodeBlocks

Post by tap1956 »

Thanks for the answer. I understood.
Post Reply