Author Topic: Bother Compiling and Starting a WxWidgets Project  (Read 5143 times)

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Bother Compiling and Starting a WxWidgets Project
« on: October 04, 2018, 09:43:08 am »
I am running Code::Blocks on Windows 10 64 bit Home Edition.
I have installed WXBuilder.

I am trying to set up WXWidgets so that I can program using those library classes.
I have successfully cleaned and built wxwidgets via an administrator mode command line,
via the following:

wxMSW-3.1.1-Setup

C:\Program Files\wxWidgets-3.1.1\build\msw

mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport" clean

mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport"


I still can't create a project with no errors.

Script error

The path you enteres seems valid, but this wizard can't
locate wxWidgets' files in it...
OK

Warning

A matching Debug configuration cannot be found in the
wxWidgets directory you specified.
Would you like to link this target against the release binaries
instead?
(Debugging the executables will still be possible.)
Yes | No


-What should I do so that I can create a WXBuilder project with no errors?
-Will this leave me with internal links from Code::Blocks to WXBuilder as well?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1560
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #1 on: October 04, 2018, 10:01:00 am »
The wizard tests if include/wx/wx.h exists in the folder you provided.
Regarding the debug configuration, it is not needed unless you want to debug wxWidgets itself, you can click on Yes safely.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #2 on: October 04, 2018, 10:18:04 am »
I don't know if you can use wxBuilder with codeblocks...

The problem is the wizard does not know about the "USE_OPENGL=1" flag. It does not search for the
Code
wxmsw310u_gl_gcc_custom.dll
but for
Code
wxmsw310u_gcc_custom.dll
Can you open a ticket on SF and report this? It should be easily fixable.. https://sourceforge.net/p/codeblocks/tickets/747/

To make quick steps you can do two things:
1) Compiler wx Without OpenGL if you don't need it
2) Fix the project by yourself:
Finish the wizard. Then go to
Project->Build options->select Debug on the left side->Linker settings->Change the name of the library accordingly  to "libwxmsw31ud_gl"
Project->Build options->select Release on the left side->Linker settings->Change the name of the library accordingly to "libwxmsw31u_gl"


For reference the way to create a new project if you compile without Opengl:
My wxWidgets installation is in
Code
G:\Programming\wxWidgets310
so the path to the dll is as follows:
Code
G:\Programming\wxWidgets310\lib\gcc_dll\wxmsw310u_gcc_custom.dll

Steps i do:
1) File->New->Project->wxWidgets
2) Next
3) select wxWidgets 3.1.x -> next
4) Enter project title. For example "testwx" -> next
5) Next
6) wxSmith -> Next
7) Enter path to wxWidgets: G:\Programming\wxWidgets310 -> Next
8) Ticks at follwoing selections:
Code
Use wxWidgets dll
wxWidgets is build as monolithic library
Enable unicode
9) Next
10) Build and run



« Last Edit: October 04, 2018, 06:47:47 pm by BlueHazzard »

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #3 on: October 05, 2018, 06:03:43 am »
I have carried out your suggestion, and find that my build still does not work.  It is not producing

wxmsw310u_gcc_custom.dll

for me at all.

I use the following two commands to attempt to do my build:

mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport" clean
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport"

Can someone reply with a better set of commands for me, please?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #4 on: October 05, 2018, 08:36:22 am »
Quote
I have carried out your suggestion, and find that my build still does not work.  It is not producing
Without error message it is impossible to solve the error.. Crystal balls are out of order since 200 years, sry...


I can compile wxWidgets and use it on codeblocks with the following command:
Code
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 CXXFLAGS="-fno-keep-inline-dllexport" clean
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 CXXFLAGS="-fno-keep-inline-dllexport"

You should delete your wxWidgets source and redownload or unzip it, to remove all not needed object files ecc...

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #5 on: October 05, 2018, 09:10:28 am »
Code::Blocks tells me the following.

Script error
The path you enteres seems valid, but this wizard can't
locate wxWidgets' files in it...
OK

...

Warning
A matching Debug configuration cannot be found in the
wxWidgets directory you specified.
Would you like to link this target against the release binaries
instead?
(Debugging the executables will still be possible.)
Yes | No



Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1560
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #6 on: October 05, 2018, 09:47:12 am »
Remove the VENDOR flag and rebuild. Then look where the include/wx/wx.h branch resides (should be in C:\Program Files\wxWidgets-3.1.1) and give that path to the wizard.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #7 on: October 05, 2018, 12:15:48 pm »
Did you try looking for "wxmsw311u_gcc_custom.dll" instead of "wxmsw310u_gcc_custom.dll"?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #8 on: October 06, 2018, 04:56:04 am »
I've got it working. Don't bother with any more assistance.  Thank you anyhow!

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1560
Re: Bother Compiling and Starting a WxWidgets Project
« Reply #9 on: October 06, 2018, 11:02:20 am »
Can you share where the problem was?. Doing so would help the next person looking for help in this thread.