Author Topic: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???  (Read 1419 times)

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Hello fellow code::blocks users!!

I have been into c++ since 2 months. To be honest i believe, I am getting quite good at it, at least little by little. But now i am really getting a headache. For the past 2 days and roughly 6 hours a day, i have been trying to get wxwidgets to work in code::blocks. I have followed install guides, youtube video's, ... really anything i could find online.

Well it just doesn't work, when i make a wxwidgets project and i choose for frame, it will always tell me that debugging wont work and after i click ok, ok, i get a screen with actually not a single .h or .cpp file. Doesnt matter what type of GUI builder i am choosing.

I have downloaded both the 2.8.12 as the 3.0.2 version, i have been trying to follow the compile guide with TDM-GCC, this itself is kind of chinese and doenst work. The make command always says, unknow internal or external command. Which leaves me with the following:

Code::Blocks is like a perfect program to learn programming in console mode, i found it easy and comprehensive. But i am under the impression that if you would like to make anything visual with buttons and graphs and so on, that code::blocks is simply an IDE to run away from. Am I right? or mistaken? ( for example after installing Qt, at least i got the basis to work in, i could learn from there )

Is there any comprehensive guide that explains exactly what to do to get this headache thing to work?
Is there anyone who suffered as much on this as me?
Would anyone be so kind to point me in the right direction to remedy my stupidity?

Thanks all.

Stephane

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5870
    • My Best Post
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #1 on: April 05, 2017, 11:07:57 pm »
Do you understand the English Language?

Do you know how to run commands from the command line?

Then, you likely can build wxWidgets.

Why do you wish to build wxWidgets projects?

On, what Operating System (OS) are you going to be building and using wxWidgets?

Edit1: What Compiler are you going to be using?

Edit2: Being able to cut and paste to and from the command line is very helpful when building from the command line.

Tim S.
« Last Edit: April 05, 2017, 11:19:39 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #2 on: April 05, 2017, 11:21:42 pm »
In short:

Yes, i can speak english, thank you very much :))))

yes, i can run commands from cmd

well, likely , apparantly it is kind of an issue

i want to build a graphical interface for a program i am writing ( environmental control panel for raspberry pi, controlling all aspects including co2 and o2 in a room.)

i would like to use it both on linux and on windows, as i am travelling a lot and sometimes i have only access to windows.

The compiler i am using no is the default build in GCC compiler in code::blocks (comes with the installer)

regards,

Stephane

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5870
    • My Best Post
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #3 on: April 05, 2017, 11:42:16 pm »
I have no idea whether wxWidgets is the best choice for raspberry pi (The answer likely depends on which pi and what OS)

Warning: wxWidgets is a C++ Library; this means you MUST in most cases decide on the Compiler and what version before starting to build wxWidgets.

NOTE: This is NOT a site to support cross-building of wxWidgets I suggest https://forums.wxwidgets.org/
I mean cross-building of wxWidgets for use on raspberry pi under some other OS.

Once, you choose which version of wxWidgets to use; since, it is a new project I suggest wxWidgets version 3.0.2.
And, I suggest building the cross-build on Linux; doing cross build on Windows is likely possible but, it is NOT likely to be easy.

Edit: The link below are all for Windows.

Overview of wxWidgets and Code::Blocks
http://wiki.codeblocks.org/index.php/WxWindowsQuickRef

Link to build wxWidgets http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_%28MSW%29

Link to directions to build wxWidgets for CB http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Windows#Build_wxWidgets_Support_Library

Tim S.
« Last Edit: April 05, 2017, 11:45:58 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #4 on: April 06, 2017, 12:03:14 am »
Ok, so i do that what is in the wiki.

When i executed from cmdline in the MSW folder:

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllex

It simply tells me that mingw32-make is an unknown internal or external command. So than there is nothing more to do.

I have a working installation of code blocks and i can compile console applications without any issues.

Every guide mentions this mingw32-make command but nowhere i find what to do if that command isn't recognised.

Stephane

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5870
    • My Best Post
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #5 on: April 06, 2017, 12:15:54 am »
Where is the Compiler you are planning to use installed?

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

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1414
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #6 on: April 06, 2017, 12:36:35 am »
@stahta01: I think cross compiling is not the question at the moment. Most of the time he can copy the code from windows to the raspberry and compile it there, or use some vm. So don't let us open this box of the pandora at the moment. Maybe we have to do it later. As there are so many issues with wxWidgets lately i can think of trying to fix this build thing here in this forum for one time and then update the wiki. I don't know why all the people have this issues, but we will see...
[EDIT:] didn't saw you answered already...

@stephanisk:
But i am under the impression that if you would like to make anything visual with buttons and graphs and so on, that code::blocks is simply an IDE to run away from. Am I right? or mistaken?
Stephane
No, it is quite easy and satisfying to use codeblocks for building gui things. It worked for 10000 other people, i don't know where all this problems lately come from. But lets try to fix this...

We will go through this for windows now
0) Disable your anti virus

1) Where have you downloaded the wxWidgets code?
Please download the code from the wxWidgets site (use a newer version wx3.XXX)

2) You have to build wxWidgets by yourself. There are binary downloads out there, but they won't match your compiler and you need that the library is compiled with the same compiler as your program... This is now a bit tricky because i can't build wxWidgets myself at the moment so i write this guide blind...
2.1) Extract the code im some folder without spaces and other non ascii characters where you have enought free space and write access

2.2) Open the extracted folder and browse to the build/msw subfolder.
2.2.1) Open a CMD there either by holding shift key and right mouse click -> Open command window here or by typing cmd in the "URL control" of the explorer. A black window should open

2.3) Make sure your compiler is in the PATH Environment variable (WARNING: For beginners there should only be ONE COMPILER INSTALLED AT THE SAME TIME on the system)
2.3.1) How can you check if the compiler is in your path? : Type mingw32-make.exe in your CMD window and hit enter. If you get "mingw32-make is an unknown internal or external command" then your compiler is not in the PATH.
2.3.2) Add the compiler path to your PATH: http://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows#9546345
NOTE: You have to find the path to your compiler by yourself. Easy way: search for "mingw32-make.exe"
NOTE: The path to your compiler should not have spaces or non ascii characters
HINT: you can use the TAB key to complete paths in the cmd by typing the first letters of the folder name and then hitting the TAB key
2.3.3) Test again if it worked with point 2.2.1)

2.4) run
Code: [Select]
mingw32-make.exe -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS="-fno-keep-inlline-dllexport -std=gnu++11"
This can take up to 60 minutes or even longer
You can detect if the build was successful if there is no "error" written in the cmd
2.4.1) If this fails run
Code: [Select]
mingw32-make.exe -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS="-fno-keep-inlline-dllexport -std=gnu++11 clean"
2.4.2) And now try
Code: [Select]
mingw32-make.exe -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=0 UNICODE=1 CXXFLAGS="-fno-keep-inlline-dllexport -std=gnu++11"
2.4.3) If this also fails report the error her (there is somewhere "error" written in the cmd. Post the appropriate line after the error

2.5) You can check if the build was successful by checking the files in the
PATH/TO/WX_SOURCE/lib/gcc_dll there should be some files called wxmsw310u_gcc_custom.dll

2.6) Start codeblocks. Create a new wxWidgets project and follow the instructions of the wizard
2.7) Have fun

If you have problems somewhere please describe EXACTLY what you have done before and please post EXACTLY the error messages you get. They are there. There are always error message and 99% of the time they give a hint why something failed...
« Last Edit: April 07, 2017, 12:51:42 pm by BlueHazzard »

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #7 on: April 06, 2017, 06:12:57 pm »
Hi BlueHazzard and the others,


Thanks for you more than clear explanation of getting this to work.

Apparantly the mingw32-make is in my path as i get a notice that there is no target specified.

So step 1 i executed and step 2 and step 3 but apparantly there is a problem with the CXXFLAGS=-fno-keep-inline-dllex

"edit= i think you have forgotten the last part -fno-keep-inline-dllexport "
"cause i am running it again and it is still working "

I post the error that appears in a screenshot. I hope you guys have a solution for this. At least i got the cmd line to start building something already :)

I would be extactic if tonight i can actually start learning instead of getting headaches :)
« Last Edit: April 06, 2017, 06:18:38 pm by stephanisk »

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #8 on: April 06, 2017, 06:19:40 pm »
It should be CXXFLAGS=-fno-keep-inline-dllexport

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #9 on: April 06, 2017, 06:25:07 pm »
hello,

So it is not working yet, i used the export flag correctly, but now i get following error

something about the c++11 standard and extra compiler info -std=c++11

How would i do this?

Stephane

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #10 on: April 06, 2017, 07:10:07 pm »
Activate c++11 mode using CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11"

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #11 on: April 06, 2017, 08:06:43 pm »
Thanks a lot,

That seems to have done the trick... BUT....

now it doesnt work in codeblocks itself, so this is the fatal error i get. Hope someone knows what exactly is going on.

I have tried all possible setups after clicking new project -> wxWidgets

But i get the same fatal error, cause the compilation works without errors, but i can not execute

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #12 on: April 06, 2017, 08:58:33 pm »
You must use the same tool chain for compiling wxWidgets and your program, edit Compiler settings -> Toolchain executables so they match.

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #13 on: April 06, 2017, 09:04:51 pm »
ok. Understand what you say, but not really understanding what you are saying. Could you elaborate a little on your explanation?? Thanks

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7191
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #14 on: April 06, 2017, 10:34:48 pm »
Make sure your project uses the same compiler you used to build wxWidgets and most likely you also need to set the "-std=gnu++11"-flag.

Offline stephanisk

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #15 on: April 06, 2017, 11:09:35 pm »
Thanks,

I been researching a little and i got it to work so far!!!!!

Thanks all for your more than elaborated help, i would never ever have found the issues without you guys, you are all super!!!

I have been experimenting a little though with wxSmith and wxFormBuilder ( cant get that to work, but anyway )  But i have also spent a few hours with Qt and it seems that qt is much easier to work with than the wxSmith. It is like more intuitive. On the other hand i have been reading that wxwidgets is very good aswell. Could anyone tell me why choose one over the other?

Thanks again for all the help!!! you are awesome!!

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1414
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #16 on: April 07, 2017, 12:44:51 am »
Quote
I been researching a little and i got it to work so far!!!!!
can you tell us (and others) what do you did, so if other have the same problem they know what to do...

Quote
I have been experimenting a little though with wxSmith and wxFormBuilder ( cant get that to work, but anyway )  But i have also spent a few hours with Qt and it seems that qt is much easier to work with than the wxSmith. It is like more intuitive. On the other hand i have been reading that wxwidgets is very good aswell. Could anyone tell me why choose one over the other?
wx uses the native window implementation on every system, qt does not (as far as i know) but this is of topic for this forum...

Offline gtafan

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #17 on: April 07, 2017, 01:49:37 pm »
There are binary downloads out there, but they won't match your compiler and you need that the library is compiled with the same compiler as your program...
Sorry, but where this binary downloads can be find? Geting rid of that anoing comandline would be really nice. Unfortunatelly have not seen binary downloads on that oficial wxWidget site. May be I am just to stupied, so apologies than.
« Last Edit: April 07, 2017, 01:51:49 pm by gtafan »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7191
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #18 on: April 07, 2017, 03:24:29 pm »
There are binary downloads out there, but they won't match your compiler and you need that the library is compiled with the same compiler as your program...
Sorry, but where this binary downloads can be find? Geting rid of that anoing comandline would be really nice. Unfortunatelly have not seen binary downloads on that oficial wxWidget site. May be I am just to stupied, so apologies than.
Go to : http://wxwidgets.org/downloads/ and search for the keyword binaries.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5870
    • My Best Post
Re: Is it humanly possible to install wxWidgets 3.0.2 for code::blocks???
« Reply #19 on: April 07, 2017, 06:20:58 pm »
There are binary downloads out there, but they won't match your compiler and you need that the library is compiled with the same compiler as your program...
Sorry, but where this binary downloads can be find? Geting rid of that anoing comandline would be really nice. Unfortunatelly have not seen binary downloads on that oficial wxWidget site. May be I am just to stupied, so apologies than.
Go to : http://wxwidgets.org/downloads/ and search for the keyword binaries.

Has the CB Wizard been fixed to use the wxTeam built Binaries?

Edit: If not, link to my old work around directions http://wiki.codeblocks.org/index.php/Using_wxWidgets_%28MSW%29_3.0_Binary_with_Code::Blocks_Scripted_Wizard

Tim S.
« Last Edit: April 07, 2017, 06:32:16 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org