Author Topic: wxWidget and code::Blocks 16  (Read 7965 times)

Offline taazz

  • Single posting newcomer
  • *
  • Posts: 8
wxWidget and code::Blocks 16
« on: May 04, 2016, 03:43:47 am »
After two days of installation re installation and fails to build wxwidgets 3.1 on windows with mingw32 I finally got it compiled and set it up on code::blocks.
I have iron out a couple of problems and I'm left with hopefully the last one. So I have created a new wxApplication and set it up to use wx 3 thats why I get the error.
Quote
ld.exe||cannot find -l||=== Build: Release in app1 (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lwxmsw30u_core|
ld.exe||cannot find -lwxbase30u|
||error: ld returned 1 exit status|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
|

which seems resonable. So the main question is what I have to change to link wxmsw31u_code instead of wxmsw30u_code?
At this point I'm completely outraged with the setup procedure and mostly the lack of a decent installer for any C/C++ IDE, so I decided to stop wasting my time and ask here. Keep in mind that I'm not interested in the "correct" way of doing things, I'm more interested in information on the config files where to look for them and how to add of change more choices (wxwidget31 for example).

thanks in advance for any inside you are willing to share.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidget and code::Blocks 16
« Reply #1 on: May 04, 2016, 04:03:08 am »
Using wxWidgets 3.1 with Code::Blocks questions.

I am trying to make the questions very general because we are getting a lot of questions related to this subject.
If you are good at Editing Wiki Pages feel free to create a page with parts of my posts. (I am very bad at Wiki Editing)

Information about your Compiler is needed.
mingw.org, MinGW64 32 bit, or MinGW64 64 bit ?
GCC version of Compiler

Did you self-build wxWidgets?
If self built; what method (configure/make) or (mingw32-make -f makefile.gcc)
If (mingw32-make -f makefile.gcc) what command was used?
Or download a prebuilt binary?
If downloaded prebuilt binary is it for your Compiler type and version?

Are you using the CB Wizard? The CB Wizard is likely broken for wxWidgets 3.1.
I am looking into ways to fix it.

If using Cygwin GCC or MSys2 GCC, please state that. These need special methods to work with Code::Blocks.

Do you plan to use wxSmith or wxFormBuilder?
If yes, which one?

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
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 taazz

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxWidget and code::Blocks 16
« Reply #3 on: May 04, 2016, 10:56:04 am »
mingw.org, MinGW64 32 bit, or MinGW64 64 bit ?
GCC version of Compiler
The compiler used by codeblocks is mingw32 as it was setup from its web installer with gcc version 4.9.3.1 or at lest I'm hopping the autodetect worked correctly.
Did you self-build wxWidgets?
I used the wxWidget 3.1 and 3.0.2 installer for windows tried to use mingww32-make and failed to build wxwidgets repeatedly, my main problem was that the compiler could not find headers like stdio.h. After a day or two trying to find any information on how to set up any environment variables that might be needed I gave up and downloaded and installed TDM-gcc-32.

I used the command shell that it sets up to run the mingw32-make -f makefile.gcc and managed to build a release version of 3.0.2, failed to build a debug version with an error message that I do not remember, I interpreted as "it does not support some cxx11 features" or something along those lines. I tried from the same shell to build the debug version of 3.1.0 and everything wend smoothly, I hope, I did not check the complete compilation output, I ended up with a number of .a file in the <installation dir>\lib\gcc_lib folder and a bit relefed that the problem was corrected on 3.1

I continued with the release build on 3.1. I made various builds with various configurations executing clean before each. I think the last one was
  mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 MONOLITHIC=0 BUILD=release and mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=debug
I had multiple fails when trying to compile a simple wxwidget demo which I managed (somehow) to shrink down to the error I posted.
I do plan to keep my builds with SHARED=1 UNICODE=1 MONOLITHIC=0 for both debug and release, I guess that by your next post I will have run a build cycle.

Are you using the CB Wizard? The CB Wizard is likely broken for wxWidgets 3.1.
I have no idea what that is, so I have to say no at this time.

If using Cygwin GCC or MSys2 GCC, please state that. These need special methods to work with Code::Blocks.
As far as I understand so far, I have not used any of those, although some msys package where installed by the mingw32 installer. I do not plan to use any unix like environment at all I prefer things as close to default installation as possible.

Do you plan to use wxSmith or wxFormBuilder?
If yes, which one?
Yes I'm planning to use both of them at first until I settle down on a favorite. So far I think I only used wxSmith and I had an acceptable experience although at some point what ever I placed on it was resize to fill the complete form. So far I prefer the frames over the dialogs design, then again I have to run a couple of sample and see how it behaves before deciding.

Please keep in mind that my c/c++ experience is 0. I'm a noob there too. which makes things geometrically harder than having to deal with code::blocks and wxWidget only.
Most hated thing so far, the fact that environment variable are needed. I considered them an unacceptable pollution, keep everything in your config files and away from my "global" system.

Any way thank you for your time and effort, I appreciate it immensely.


This CB FAQ might answer your question; but, you likely will have more questions.
Thank you, I will take a close look on that.
« Last Edit: May 04, 2016, 11:03:32 am by taazz »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidget and code::Blocks 16
« Reply #4 on: May 04, 2016, 01:01:14 pm »
I see at least a half dozen possible errors you might have made.
But, the main one is I have no Idea what C++ Compiler you are really using; and, I do NOT think you know either.

I will see if I can write up some newbie style directions that use the wxWidgets built binaries because I think that is a major stumbling block for newbies.

No idea how many days this will take me. You will have to download an TDM GCC Compiler to match the wxWidgets 3.1.0 built binaries.

From https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.0
Quote
MinGW-TDM versions 4.9 and 5.1 (with the default SJLJ exceptions propagation method, using C++11).


I will see if the directions can support wxSmith; might try wxFormBuilder if I secede in getting wxSmith working.

I will be using an wx-config.exe to set most of the wxWidgets setting in Code::Blocks.

I have plans to add an option to the CB Wizard to use wx-config.exe in the future.

I strongly recommend newbies have only one MinGW GCC based compiler installation on their computers they can interfere with each other! 

Edit: I would NOT be surprised if wxSmith and wxFormBuilder are both partly (or mostly) broken with wxWidgets 3.1.

I will NOT be able to help you using wxSmith and wxFormBuilder; I am a newbie with both.

Tim S.
« Last Edit: May 04, 2016, 01:10:07 pm 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidget and code::Blocks 16
« Reply #5 on: May 04, 2016, 01:54:48 pm »
Since you are a newbie, do you have any reason why you are NOT using wxWidgets version 2.8 or 3.0 instead of version 3.1?

I noticed you had issues building wxWidgets 3.0; is that the main reason you are trying the development version of 3.1.0?

Because if it is a issue building wxWidgets; I would suggest going with wxWidgets 3.0.2.

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 taazz

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxWidget and code::Blocks 16
« Reply #6 on: May 04, 2016, 01:56:44 pm »
I see at least a half dozen possible errors you might have made.
Good! half a dozen is a manageable amount of errors. If you be so kind to name them so I can start working on them and see what I can come up with that would be grate.


But, the main one is I have no Idea what C++ Compiler you are really using; and, I do NOT think you know either.
True! But I made sure that my path variable references only one installation at all times which did not help at all. I have tried to remove all references from the path as well calling the mingw32-make utility using the complete path which failed too. Just for the sake of it I opened the TDM shell and got the compiler version from there so here are the results.

Quote
C:\wxWidgets-3.1.0\build\msw>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/TDM-GCC-32/bin/../libexec/gcc/mingw32/5.1.0/lto-wrapper.exe
Target: mingw32
Configured with: ../../../src/gcc-5.1.0/configure --build=mingw32 --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --ena
ble-graphite --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads
--enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --disable-symvers --enable-cxx-flags='-fno-function-sections -fno
-data-sections -DWINPTHREAD_STATIC' --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm --with-pkgversion=tdm-1 --enable-sjlj-exceptions --with-bu
gurl=http://tdm-gcc.tdragon.net/bugs
Thread model: posix
gcc version 5.1.0 (tdm-1)
Am I correct to assume that the compiler version 5.1.0?

I will see if I can write up some newbie style directions that use the wxWidgets built binaries because I think that is a major stumbling block for newbies.
Well that is one way to go but it will not work for me. My ultimate goal is to set up a cross compilation environment to allow me to use windows as a developing environment for every target I might need.

No idea how many days this will take me. You will have to download an TDM GCC Compiler to match the wxWidgets 3.1.0 built binaries.
Well can I have a couple of pointers that will allow me to work my way up? The idea is that I learn by solving using your hints as guides and in the process learn more than solving the specific problem. I know it looks counter intuitive but its my way of learning.
From https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.0
Quote
MinGW-TDM versions 4.9 and 5.1 (with the default SJLJ exceptions propagation method, using C++11).

I will see if the directions can support wxSmith; might try wxFormBuilder if I secede in getting wxSmith working.

I will be using an wx-config.exe to set most of the wxWidgets setting in Code::Blocks.

I have plans to add an option to the CB Wizard to use wx-config.exe in the future.
As far as I understand it would be beneficial for both of us to point me to how the basics of the wizard mechanism work so I can troubleshoot my problem, that way I will be able to help in some small way as well hopefully freeing you some time to spend on more interesting things.
I strongly recommend newbies have only one MinGW GCC based compiler installation on their computers they can interfere with each other! 
Yeah I heard about that. Searching the net I see only generic statements and nothing to point in the problem it self ee config xxx is global or environment variable xy need to point to what ever. The problem is that not knowing how to validate the installation it makes it impossible for me to learn how to find problematic configurations and that is more damaging than any lack of information could ever be.
Edit: I would NOT be surprised if wxSmith and wxFormBuilder are both partly (or mostly) broken with wxWidgets 3.1.

I will NOT be able to help you using wxSmith and wxFormBuilder; I am a newbie with both.
That's OK, I'm here to learn how to validate code block installations what I need to look for and how to identify possible friction points. I'm not here to give me an executable that will do the work for me that would be grate and all but the moment you moved on to other projects, I would end up on the same position I'm now.

Offline taazz

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxWidget and code::Blocks 16
« Reply #7 on: May 04, 2016, 02:03:06 pm »
Since you are a newbie, do you have any reason why you are NOT using wxWidgets version 2.8 or 3.0 instead of version 3.1?

I noticed you had issues building wxWidgets 3.0; is that the main reason you are trying the development version of 3.1.0?

Because if it is a issue building wxWidgets; I would suggest going with wxWidgets 3.0.2.
Yes I could not build 3.0.2 in debug mode and still can't here is the result of my latest effort
Quote
C:/TDM-GCC-32/lib/gcc/mingw32/5.1.0/include/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and
library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++
11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from ..\..\include/wx/string.h:46:0,
                 from ..\..\include/wx/any.h:19,
                 from ../../src/common/any.cpp:18:
..\..\include/wx/strvararg.h:350:18: error: 'is_enum' in namespace 'std' does not name a template type
     typedef std::is_enum<T> is_enum;
                  ^
..\..\include/wx/strvararg.h:354:54: error: 'is_enum' was not declared in this scope
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
                                                      ^
..\..\include/wx/strvararg.h:354:68: error: template argument 1 is invalid
     enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
                                                                    ^
makefile.gcc:11370: recipe for target 'gcc_mswuddll\basedll_any.o' failed
mingw32-make: *** [gcc_mswuddll\basedll_any.o] Error 1
If that makes any more sense to you. I'd rather not go to older releases but if everything else fails I might give it a go.

Offline taazz

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxWidget and code::Blocks 16
« Reply #8 on: May 04, 2016, 02:33:20 pm »
Well I managed to build the release build of wxWidget with the mingW installation as well, the only think I had to do was to move the path for the mingw as the first in the path variable instead of last, that seems to solve all my primary problems but still stop on the same file on the debug build as the tdm installation. At last now I have a new research point to move forward. I bet that I could also rename the xxxx31xxx.a to xxxx30xx.a and have everything working at this point too but a hint on what I need to change to directly link with xxx31xx instead would be preferred.

I can now also attest that mingw gg++ version is 4.3.9 and tdm g++ version is 5.1 which makes it a bit scary.

I found the wxWidget 2_6_4 and 2_8_8 in the header fixup configurations but I don't see 3_0_2 which I'm able to select using the wizard.
« Last Edit: May 04, 2016, 02:35:43 pm by taazz »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidget and code::Blocks 16
« Reply #9 on: May 04, 2016, 03:02:34 pm »
If you really want to cross build and you are from an Unix/Linux world.
I would suggest going with MSys2 instead of mingw.org compiler.
The MSys2 compiler is based on MinGW64 instead of mingw.org.
It has both 32 bit and 64 bit versions of MinGW64 GCC 5.3 Compiler.

I am working on making a wx-config.exe wrapper for MSys2.
The wx-config shell script is how Linux users do wxWidgets.

Link to my wx-config.exe wrapper https://github.com/stahta01/msys2_wx_config_exe I have about 2 days work finished on it. Link to some CB Projects that I am using to test my wx-config.exe wrapper.
https://github.com/stahta01/cb_projects_for_wxWidgets/tree/wxWidgets-3.1.0

I just looked at the wx-config.exe code for working with "mingw32-make -f makefile.gcc" it will take me a few days to decide if junking the code or fixing the code is the best path. I am a C Programmer learning C++ and the code is hard to follow.

If you wish to use CB Global Variables I might be able to do a quick fix on the Wizard to support version 3.1.0.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidget and code::Blocks 16
« Reply #10 on: May 04, 2016, 04:08:50 pm »
You need to add the option "-std=gnu++11" or define HAVE_TR1_TYPE_TRAITS to build wxWidgets 3.0.2 or you can patch the wxWidgets bug that was posted on this site a while back. I forgot who posted it he suggested using the patch as the proper solution and he is right. Searching on HAVE_TR1_TYPE_TRAITS should find the patch on this sit.
Added link to the post with the link offsite http://forums.codeblocks.org/index.php/topic,20607.msg140165.html#msg140165

Tim S.

Yes I could not build 3.0.2 in debug mode and still can't here is the result of my latest effort
Code
C:/TDM-GCC-32/lib/gcc/mingw32/5.1.0/include/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and 
library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++
11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
« Last Edit: May 04, 2016, 04:14:23 pm 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidget and code::Blocks 16
« Reply #11 on: May 04, 2016, 05:29:50 pm »
I have made progress on fixing the wx-config.exe for mingw32-make builds.

So, I am going to work on that for a while. I removed code that I thought was NOT needed till I saw the problem.
Note: My fix likely breaks some of the nice but not needed features of wx-config.exe.

Edit: I really need to get some sleep. I have fixed the only the MinGW GCC for use with the wxWidgets team built binary.
The same type of changes should also fix it for Visual Studio; but, I have been up over 26 hours straight. I hope this insomnia goes away. Link to https://github.com/stahta01/wx-config-win.

I decided that making wxSmith projects is beyond me. I will put my effort into getting the CB wxWidgets Wizard to use wx-config.exe.

I will write up directions on how to use the CB Project I created with wxTeam built binaries when I feel better.
Link to the sample CB Projects https://github.com/stahta01/cb_projects_for_wxWidgets/tree/wxWidgets-3.1.0

Tim S.

« Last Edit: May 04, 2016, 08:51:08 pm 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 taazz

  • Single posting newcomer
  • *
  • Posts: 8
Re: wxWidget and code::Blocks 16
« Reply #12 on: May 05, 2016, 01:15:19 am »
You need to add the option "-std=gnu++11" or define HAVE_TR1_TYPE_TRAITS to build wxWidgets 3.0.2 or you can patch the wxWidgets bug that was posted on this site a while back.
that helped me to build wxwidget with both environment adding the option
Quote
CXXFLAGS="-std=gnu++11"
in the command line.

I forgot who posted it he suggested using the patch as the proper solution and he is right. Searching on HAVE_TR1_TYPE_TRAITS should find the patch on this sit.
Added link to the post with the link offsite http://forums.codeblocks.org/index.php/topic,20607.msg140165.html#msg140165
Tim S.
Now of to read up on the link provided, hopefully it will provide inside on why building a wxSmith application raises the same problem now.

I have made progress on fixing the wx-config.exe for mingw32-make builds.

So, I am going to work on that for a while. I removed code that I thought was NOT needed till I saw the problem.
Note: My fix likely breaks some of the nice but not needed features of wx-config.exe.

Edit: I really need to get some sleep. I have fixed the only the MinGW GCC for use with the wxWidgets team built binary.
The same type of changes should also fix it for Visual Studio; but, I have been up over 26 hours straight. I hope this insomnia goes away. Link to https://github.com/stahta01/wx-config-win.

I decided that making wxSmith projects is beyond me. I will put my effort into getting the CB wxWidgets Wizard to use wx-config.exe.

I will write up directions on how to use the CB Project I created with wxTeam built binaries when I feel better.
Link to the sample CB Projects https://github.com/stahta01/cb_projects_for_wxWidgets/tree/wxWidgets-3.1.0

Tim S.
I have no idea how or where wx-config is used so I do not know how helpful it is, get some sleep. personally I have a lot of pocking around to do inside the IDE to see where things are and most importantly what they are. Too many options to work with it will take some time. I grepped inside the codeblocks directory and found out that the 28, 16, 30 are hard coded inside the wizard's code which 1) is a bit backwards with my own logic and 2) not easily patched.

Any way thank you for your time, it is appreciated immensely.