Author Topic: CodeBlocks Msys2 and wxWidgets  (Read 1047 times)

Offline tumanovalex

  • Multiple posting newcomer
  • *
  • Posts: 13
CodeBlocks Msys2 and wxWidgets
« on: March 01, 2020, 06:48:10 pm »
CodeBlocks Msys2 and wxWidgets
Windows 10 Home 64 bit. Installed CodeBlocks from codeblocks-17.12-nosetup.zip by simply copying it to drive C. Using Msys2 I downloaded the necessary tools (pacman -S --needed mingw-w64-x86_64-toolchain), specified the necessary directory in CodeBlocks (C: \ msys64 \ mingw64 \ bin \) and the necessary tools. The console application was created normally, everything works. I decided to try to make a wxWidgets project. I decided to try to make a wxWidgets project. Installed wxWidgets (pacman -S mingw-w64-x86_64-wxWidgets). Specified in the project properties a directory for searching wxWidgets files. When I try to debug, I get messages:
C: / msys64 / mingw64 / bin /../ lib / gcc / x86_64-w64-mingw32 / 9.2.0 /../../../../ x86_64-w64-mingw32 / bin / ld.exe: cannot find -lwxmsw30ud
C: / msys64 / mingw64 / bin /../ lib / gcc / x86_64-w64-mingw32 / 9.2.0 /../../../../ x86_64-w64-mingw32 / bin / ld.exe: cannot find -lwxpngd
C: / msys64 / mingw64 / bin /../ lib / gcc / x86_64-w64-mingw32 / 9.2.0 /../../../../ x86_64-w64-mingw32 / bin / ld.exe: cannot find -lwxjpegd
C: / msys64 / mingw64 / bin /../ lib / gcc / x86_64-w64-mingw32 / 9.2.0 /../../../../ x86_64-w64-mingw32 / bin / ld.exe: cannot find -lwxtiffd
C: / msys64 / mingw64 / bin /../ lib / gcc / x86_64-w64-mingw32 / 9.2.0 /../../../../ x86_64-w64-mingw32 / bin / ld.exe: cannot find -lwxzlibd
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute (s), 42 second (s))
Please tell me how to properly configure the project. The project has attached.
« Last Edit: March 01, 2020, 07:02:48 pm by tumanovalex »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7011
    • My Best Post
Re: CodeBlocks Msys2 and wxWidgets
« Reply #1 on: March 01, 2020, 07:58:32 pm »
Custom variable and value
Code: [Select]
WX_SUFFIX=u
WX_TOOLKIT=msw
WX_VERSION=3.0

Compiler search directories
Code: [Select]
$(TARGET_COMPILER_DIR)lib\wx\include\$(WX_TOOLKIT)-unicode-$(WX_VERSION)
$(TARGET_COMPILER_DIR)include\wx-$(WX_VERSION)

Resource Compiler search directories
Code: [Select]
$(TARGET_COMPILER_DIR)include\wx-$(WX_VERSION)

Names I use for shared wx libraries
Code: [Select]
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_gl-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_stc-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_propgrid-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_xrc-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_richtext-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_aui-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_html-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_adv-$(WX_VERSION).dll
wx_$(WX_TOOLKIT)$(WX_SUFFIX)_core-$(WX_VERSION).dll
wx_base$(WX_SUFFIX)_xml-$(WX_VERSION).dll
wx_base$(WX_SUFFIX)_net-$(WX_VERSION).dll
wx_base$(WX_SUFFIX)-$(WX_VERSION).dll

# Static MSys2 wx library names
Edit: For some reason I had to use full path names for the Static library to be used.
It tried to use the DLLs when I did not use fullpath.
Code: [Select]
$(TARGET_COMPILER_DIR)lib/libwx_$(WX_TOOLKIT)$(WX_SUFFIX)_core-$(WX_VERSION).a
$(TARGET_COMPILER_DIR)lib/libwx_base$(WX_SUFFIX)-$(WX_VERSION).a
« Last Edit: March 02, 2020, 01:25:34 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7011
    • My Best Post
Re: CodeBlocks Msys2 and wxWidgets
« Reply #2 on: March 02, 2020, 12:25:16 am »
 Attached a zipped fixed CB Project with name of cbWxWid-msys2.cbp.
It uses the MSys2 MinGW wxWidgets package.
Edit: Static build was used; since, that was what your project used.
I had to add the linker option of "-Wl,--allow-multiple-definition" to get around linker dup error.
Edit2: Removed too many things to list; because they are wrong for using MSys2 MinGW wxWidgets package.

Tim S.
« Last Edit: March 02, 2020, 01:23:58 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org