Author Topic: Get wxWidgets 3.0 to work on C::B, Win7  (Read 27440 times)

Offline thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Get wxWidgets 3.0 to work on C::B, Win7
« on: January 31, 2014, 11:48:42 pm »
Hello everyone ! It's my first post here, and great to see such a lively community of C::B users.

I am fairly new to programming in C++, and totally new to using 3rd party libraries, so please have patience and don't mind my silly questions  :) Today I have been trying to set up wxWidgets for use with C::B, with no success. I am using Win 7, 64 bit. I downloaded the latest version of C::B ( codeblocks-13.12mingw-setup.exe ), and the latest wxWidgets 3.0 package ( wxMSW-3.0.0_gcc471TDM_x64_ReleaseDLL.7z ) and installed both. I tried to follow the guide on this page : http://wiki.wxwidgets.org/CodeBlocks_Setup_Guide
I followed steps and did what it said, but honestly, I had no idea what was going on, because I have never before compiled a library. Nor do I know what these steps mean and what they do. I ended up with trying to run a basic wxWidget 3.0 project on C::B, but ( surprisingly !  ;D ) it didn't work, because of missing files / headers.

During the process of following the guide, I believe I have messed things up. Therefore, I would like to clean up the mess first. And then, hopefully with your help, set things up and running as they should be. I would greatly appreciate your guidance through the process, and if possible also an explanation of what the single steps are. It would benefit me greatly in my learning process, and probably to others with similar issues as well !  :)
Thank you very much, and keep up the great work with the forum  :)


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #1 on: February 01, 2014, 01:38:03 am »
Read the stuff on this link http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

After glancing at that link it will be clear that you need to build wxWidgets or download a pre-built wxWidgets.
(Finding a correct pre-built wxWidgets 3.0 seems to be challenging at this time; found one with no info on which compiler
it is valid for and at 900 MB its to build for me to check.)

Have you decided on the Compiler you are going to be using?

Your prior post implied MinGW GCC; but, it was NOT clear to me if that was a decision on your part.

Tim S.
« Last Edit: February 01, 2014, 01:42:53 am by stahta01 »
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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #2 on: February 01, 2014, 01:46:05 am »
Thank you for your answer.

I will try to follow the instructions of your provided link. But most likely I still won't understand the process, and can repeat same mistakes again. Besides, I am afraid I have already made some "damage" during the setup, that can negatively affect my next attempt.

I didn't make any decision on Compiler. It seems C::B comes with MinGW GCC, so that sounds like a reasonable choice. If there are any big differences or considerations I should take, please don't save words. I have much to learn, and I have just started  :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #3 on: February 01, 2014, 01:52:00 am »
Thank you for your answer.

I will try to follow the instructions of your provided link. But most likely I still won't understand the process, and can repeat same mistakes again. Besides, I am afraid I have already made some "damage" during the setup, that can negatively affect my next attempt.

I didn't make any decision on Compiler. It seems C::B comes with MinGW GCC, so that sounds like a reasonable choice. If there are any big differences or considerations I should take, please don't save words. I have much to learn, and I have just started  :)

Other than wasting time and hard-disk space I know of no reason not to use "MinGW GCC".
(The waste happens if you decide to change versions or makes of compilers.)

When using Code::Blocks MinGW GCC is the normal choose for Windows users; but, MinGW GCC has many different versions to pick from.

Building wxWidgets on my slow 32 bit computer takes 2 hours and about 2 gigs of hard-drive space.

If you download a pre-built wxWidgets the compiler version needs to be an almost prefect match for it to work with your compiler selection.

Tim S.
« Last Edit: February 01, 2014, 01:54:38 am by stahta01 »
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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #4 on: February 01, 2014, 01:59:24 am »
Can you please point me to location of pre-built wxWidgets ? Is it a shortcut that can save me of the problems I am having with building ?
What procedure do I need to take, if it is different from the one on your link ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #5 on: February 01, 2014, 02:14:48 am »
Can you please point me to location of pre-built wxWidgets ? Is it a shortcut that can save me of the problems I am having with building ?
What procedure do I need to take, if it is different from the one on your link ?

You have high speed internet you can try download a 1 gigabyte file it would take me longer to download the file than to build.
And, you might be wasting time downloading a file you can't use.

Link to the new wxPack site https://github.com/rjpcomputing/wxpack/wiki

Reading more about the site; I am guessing you built wxWidgets MinGW64 both 32-bit and 64-bit.
If you decided to download wxPack; I suggest trying TDM version of MinGW64 and see if it works with wxPack before trying the MinGW64 version.

Tim S.
« Last Edit: February 01, 2014, 02:25:43 am by stahta01 »
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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #6 on: February 01, 2014, 02:20:54 am »

You have high speed internet you can try download a 1 gigabyte file it would take me longer to download the file than to build.
And, you might be wasting time downloading a file you can't use.

Link to the new wxPack site https://github.com/rjpcomputing/wxpack/wiki

Tim S.

Is this the one distro that includes the entire library + graphical development tools ? I have been looking for it, but didn't find it ( or didn't know that was it, ).

I can download 1 gigabyte file in a reasonable time. Why is this file 1 GB in size, but the built libraries that you mentioned take 2 GB ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #7 on: February 01, 2014, 02:28:51 am »

You have high speed internet you can try download a 1 gigabyte file it would take me longer to download the file than to build.
And, you might be wasting time downloading a file you can't use.

Link to the new wxPack site https://github.com/rjpcomputing/wxpack/wiki

Tim S.

Is this the one distro that includes the entire library + graphical development tools ? I have been looking for it, but didn't find it ( or didn't know that was it, ).

I can download 1 gigabyte file in a reasonable time. Why is this file 1 GB in size, but the built libraries that you mentioned take 2 GB ?

It is zipped up and the 2 GB was just a guess of total space used.

Try clicking on the downloads link. https://github.com/rjpcomputing/wxpack/wiki

The one with 3.0 in the name.

Quote
Reading more about the site; I am guessing you built wxWidgets MinGW64 both 32-bit and 64-bit.
If you decided to download wxPack; I suggest trying TDM version of MinGW64 and see if it works with wxPack before trying the MinGW64 version.

Hey, I just noticed the download has a link with the Compiler the wxWidgets was built with.
You will likely need both of the downloads. Skip the wxPack 2.8 unless you wish to do 2.8 in addition to 3.0 wxWidgets.

Note: The on-line info is better for 2.8 and CB works better with 2.8 so you might be better off with 2.8.

Tim S.
« Last Edit: February 01, 2014, 02:33:20 am by stahta01 »
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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #8 on: February 01, 2014, 02:42:16 am »
Right now I am slightly confused  ??? I am currently downloading the "wxPack_v3.0.00.03.exe" . What to do after it finishes the download ? Will I need to download something else ?

Quote
Note: The on-line info is better for 2.8 and CB works better with 2.8 so you might be better off with 2.8.

Do you have personal experience in developing apps with wxWidgets ? Better on-line info for 2.8 and better CB support are great arguments to use this version. Do you happen to know if there's a big difference between 2.8 and 3.0 ? Surely 3.0 must be better developed version, and some day good on-line doc will appear too, so I don't want to stay too much behind ...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #9 on: February 01, 2014, 02:54:19 am »
Right now I am slightly confused  ??? I am currently downloading the "wxPack_v3.0.00.03.exe" . What to do after it finishes the download ? Will I need to download something else ?

Quote
Note: The on-line info is better for 2.8 and CB works better with 2.8 so you might be better off with 2.8.

Do you have personal experience in developing apps with wxWidgets ? Better on-line info for 2.8 and better CB support are great arguments to use this version. Do you happen to know if there's a big difference between 2.8 and 3.0 ? Surely 3.0 must be better developed version, and some day good on-line doc will appear too, so I don't want to stay too much behind ...

I have only really complied projects using wxWidgets; I have never written projects using wxWidgets.

The 3.0 download should contain the wx tools; no idea how good the wxWidgets tool is/are in wxPack.
I do know wxSmith part of Code::Blocks currently works better with wxWidgets 2.8.
But, the CB Team is working on fixing all the wxWidgets 3.0 bugs in wxSmith as they are reported.
I have NOT paid attention on how quickly the fixes are being done to wxSmith.

You will NEED to download the TDM Compiler, also.
wxWidgets is a C++ Library; C++ Library often need a closely matching compiler for the Library to work correctly or at all.

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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #10 on: February 01, 2014, 03:53:19 am »
I have installed wxPack 3.0 and also TDM compiler.

Can someone help me with telling how to start using wxWidgets in C::B ? If I try create a wxWidgets project, I have several options to choose, and none of them worked so far. I can choose first -> Preferred GUI builder ( none / wxSmith / wxFormBuilder )  & application type ( Dialog Based / Frame Based ).

If I choose, for example, wxSmith and Dialog based, it asks me for the location of wxWidgets on my computer. In my case, this is : O:\SourceCode\Libraries\wxWidgets3.0 , so that is my entry there. Then it asks for compiler and configuration - I leave it as it is, GNU GCC Compiler with "create debug" and "create release" boxes ticked. Next comes a selection of many options in 2 categories : wxWidgets Library Settings and Miscellaneous Settings - I have no clue what should be the right choices here. And no matter what I choose ( or not choose ) here, after clicking "next" I get the warning message saying :
" A matching Debug configuration cannot be found in the wxWidgets directory you specified. This means that Debug target of your project will not build. Are you sure you want to continue with these settings ? ":

If I leave all the option boxes unchecked, and respond to the warning message with "OK" 2 times, I get to the project window with editor box. A sample GUI window ( Welcome to wxWidgets ) is there, but of course trying to build the project won't work. Log gives 1 error, which is :

||=== Build: Debug in gh (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lwxmsw30ud|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 6 second(s)) ===|

What am I missing ? What are the settings I should be careful about choosing ?


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #11 on: February 01, 2014, 03:57:14 am »
I have installed wxPack 3.0 and also TDM compiler.

Can someone help me with telling how to start using wxWidgets in C::B ? If I try create a wxWidgets project, I have several options to choose, and none of them worked so far. I can choose first -> Preferred GUI builder ( none / wxSmith / wxFormBuilder )  & application type ( Dialog Based / Frame Based ).

If I choose, for example, wxSmith and Dialog based, it asks me for the location of wxWidgets on my computer. In my case, this is : O:\SourceCode\Libraries\wxWidgets3.0 , so that is my entry there. Then it asks for compiler and configuration - I leave it as it is, GNU GCC Compiler with "create debug" and "create release" boxes ticked. Next comes a selection of many options in 2 categories : wxWidgets Library Settings and Miscellaneous Settings - I have no clue what should be the right choices here. And no matter what I choose ( or not choose ) here, after clicking "next" I get the warning message saying :
" A matching Debug configuration cannot be found in the wxWidgets directory you specified. This means that Debug target of your project will not build. Are you sure you want to continue with these settings ? ":

If I leave all the option boxes unchecked, and respond to the warning message with "OK" 2 times, I get to the project window with editor box. A sample GUI window ( Welcome to wxWidgets ) is there, but of course trying to build the project won't work. Log gives 1 error, which is :

||=== Build: Debug in gh (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lwxmsw30ud|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 6 second(s)) ===|

What am I missing ? What are the settings I should be careful about choosing ?



I would ignore a matching " Debug target" can NOT be found; just try building the release for now.

To get the "Debug target" to work try the below items in the CB wxWidgets wizard.

Did you try clicking yes on "Using the wxWidgets release binaries"?

Or if that fails, try checking on "Configure advanced options" and make sure the checkmark is NOT in front of "Use __WXDEBUG__"

Note: Using the wizards is about as far as my wxWidgets knowledge goes. The only other things I do is build wxWidgets Lib and the wxWidgets samples.

Tim S.
« Last Edit: February 01, 2014, 04:06:33 am by stahta01 »
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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #12 on: February 01, 2014, 04:06:49 am »
Did you try clicking yes on "Using the wxWidgets release binaries"?

Or if that fails, try checking on "Configure advanced options" and make sure the checkmark is NOT in front of "Use __WXDEBUG__"

I am sorry, where does the "Using the wxWidgets release binaries" question appear ? I didn't notice it.

I have also tried the 2nd option you suggested, with same build message result :/

OK, I apologize if my questions go too far with respect to your regular usage of wxW and C::B . Could you tell me in that case the simplest way you think I could make it work ? Carrying in mind the fact that I am a complete newbie and can't do any magic.
« Last Edit: February 01, 2014, 04:09:46 am by thor36 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #13 on: February 01, 2014, 04:09:24 am »
What compiler are you using?

Did you configure Code::Blocks to use the Compiler that works with the wxWidgets you downloaded?

Please list all the files in the wxWidgets lib folder that are or type DLL?
This should help me to determine which options are correct for use in the wizard.

In my case the DLL are in this folder "C:\wxMSW-3.0\wxWidgets-3.0.0\lib\gcc_dll"
You are likely under "lib\gcc_dll" if in another location it might have a issue or it might not.

The DLLs in my folder are: Yours might have a very different name; the name will tell what options are correct.
Code
wxmsw30u_gcc_cb.dll
wxmsw30u_gl_gcc_cb.dll

Also, look for an "lib\gcc_lib" folder it might work also.

Tim S.
« Last Edit: February 01, 2014, 04:14:22 am by stahta01 »
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 thor36

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Get wxWidgets 3.0 to work on C::B, Win7
« Reply #14 on: February 01, 2014, 04:13:55 am »
If I go to Settings -> Compiler , the selected Compiler there is GNU GCC Compiler , as is the case at configuring the project.

I have downloaded wxPack 3.0, which had an easy setup procedure. And as far as my understanding goes, it installed already built wxW library, so I don't think I came across any Compiler selection in that process, nor was any mentioned.

------

in "wxWidgets3.0" , I have folders "lib" and "lib64". Each of those contain same 6 folders, named : gcc48_dll, gcc48_lib, vcc100_dll, vcc100_lib, vcc120_dll, vcc120_lib

The 3 folders with endings "_dll" contain dll files, among others

In "lib" , folder "gcc48_dll" ( assuming this is the right folders ? ) has 34 .dll files . Some of them start with "wxmsw30u" , but they have appendices, for example "wxmsw30u_gl_gcc48.dll"
« Last Edit: February 01, 2014, 04:33:21 am by thor36 »