Author Topic: wxWidgets don't work  (Read 8826 times)

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #15 on: April 12, 2016, 09:58:09 pm »
Many thanks for the very considerable effort you have provided, and thank you for the extra code.  We report on our findings, but really, it looks to us that the MSys2 approach is too heroic at this time, as discussed below.

We've performed various tests with the provided code. Though we are not sure we actually understand the manner in which the provide code is to be used:

1) Attempting to create a new project: we cannot get past the line 363, 1022 etc errors listed previously.

2) Copy the provided files to Templates, no apparent difference.

3) Copy the provided files to one of the "failed" earlier attempts to create a new wx project.  This actually launches a project, but then on attempting to compile there are all the same errors we spoke of in our previous experiments with MSys2, most notably, CB's expectation of Dir locations vs. what is actually on the machine, and detailed again in the P.S. below.  In addition, there were other "weirdness" as well, but leave those for another time.


We wonder if the "MSys2 experiment" is the best way forward, c.f. perhaps the traditional "CB specific" install approach might be more achievable.

Please keep in mind that all we really need at this point is a CB installation that can make use of standard wx for standard wx projects, such being able to do the "hello world" example here (http://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Hello_world), which relies on a wx installation following the "CB Instructions" (and NOT MSys2), such as those here (http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_%28MSW%29).

As previously, we were able to follow the "CB instructions" and completed the "make".  We have that entire "CB specific make" on the machine, and entirely independent of any MSys or MSys2 installation.  It has the monolithic dll, but we can't get CB to see the bits, perhaps due to the "CB make instructions" creating a dir structure that may not be suitable, or we have gone wrong somewhere without knowing it.

We don't understand why "CB instructions" then does not allow us to immediately perform the "tutorial", as should be possible according to CB web page.


Would it make more sense, and be less expensive and achievable, to get the "CB instructions" to work, rather than fork off on a completely different approach (e.g. MSys2)?   We don't even know enough to answer that question, so we are relying on CB's expertise.


Please advise on the least expensive direct route to have a sufficient CB/wx installation to perform, say, the CB wx hello world tutorial.


PS


Also, purely as a FYI, the MSys2 bit you had kindly produced, continues to look for wx.h in a dir called \include\wx.  Neither MSys2, nor a traditional build from scratch in classical MSys/MingW creates such a Dir.  Instead, those installs have a dir \include\wx-3.0\wx.  Thus, any and all of the CB/squirl etc bits that have lines like #include "include/wx" will fail, and/or require global replace of some sort.  There are other such examples, too, to be left for another day.

Also, Neither MSys2, nor a traditional build from scratch in classical MSys/MingW creates monolithic.  Which may explain the script/squirl errors, such as at line 1022, when testing the MSys."X" installs.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #16 on: April 12, 2016, 11:54:34 pm »
I give up because I am failing to communicate with you. I have no idea what I am doing wrong.
But, you give no info that help me help you.

Edit: IMHO, till you know how to create a CB Project that does what you want; you do NOT know enough to edit the CB Wizard to create the CB Project you want.

Edit2: How to use the project I attached as a zip file.
1. You unzip it.
1B. You edit the CB GCC Compiler so it has the correct compiler custom variable COMPILER_PREFIX
2. You open the project using Code::Blocks
3. You try to build the project.
4. You post the full re-build log to figure out what went wrong.

Edit3: Likely things to go wrong.
User failed to add "Additional path" needed to find the correct sh.exe
User failed to add the sed package to MSys2


Edit4: My own thread on CB wxWidgets Wizard http://forums.codeblocks.org/index.php/topic,21094.0.html

Tim S.
« Last Edit: April 13, 2016, 03:58:07 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 DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #17 on: April 13, 2016, 03:17:37 pm »
I feel your frustration, but in all fairness, we have provided (MANY) detailed reports of exactly what went wrong and why, in which line, etc etc, and what effects various edits had.

... we have now 6-man-days into to this matter, and quite frankly that is a substantial investment considering that an alternative approach might get us to a working solution for much less expense.

... THAT IS why, we are thinking of "dumping the MSys2 approach", and asking about getting the "traditional CB specific wx" install (as per that CB official pages) working, but we don't know why that wont accept the dll's, as reported with some frequency in the previous submissions.



Having said so, and just to demonstrate again exactly what we had reported on multiple occasions, when we follow your (MSys2) instructions, as we had in the past, and showed screen prints (see previous submissions), and detailed reports etc, we repeated the entire process again.


1) Make sure all settings are as per your (MSys2) instructions (see previous screen prints)

2) Create brand new dir/unzip your files.

3) open project, make sure project specific settings are as per your instructions (see previous screen prints)

4) try to build:

... crashes on #include <wx/app.h> in wx30Msys2App.h (see attached log 1)

keeping in mind that the MSys2 (or any MingW) install has

D:\Apps\msys64\mingw32\include\wx-3.0\wx

,, NOT

D:\Apps\msys64\mingw32\include\wx

... so comment out orig line and make change as:


//DrO, #include <wx/app.h>
#include <wx-3.0/wx/app.h>

... no try build again,


... now it crashes in app.h, (see attached log 2, 3)

#include "wx/event.h"       // for the base class in App.h

... so try same trick above, comment out orig, and replace with adjusted

//DrO, #include "wx/event.h"       // for the base class
#include "wx-3.0/wx/event.h"       // for the base class

... now it crashes in event.h (see attached log 4, 5)

... so do same edit as before

//DrO, #include "wx/defs.h"
#include "wx-3.0/wx/defs.h"

... try build again,

... this goes on and on, exactly as it did in all the previous experiments, which we provided in detail in the previous submissions.


... DECIDED to set extra search path in Project compiler and linker settings: D:\Apps\msys64\mingw32\include\wx-3.0
... and also "undid" all of the custom edits above


... closed CB, and restarted CB

... tried to open project, this time, big surprise, get three dialogue boxes to the effect:

"cc1plus.exe - Unable to locate component"
"This application has failed to start because libgmp-10.dll was not found....."



All of this sort of behaviour had been reported repeatedly with repeated experiments in the past.  If you still think MSys2 is the way to go, OK, but we really need something that works soon ... remember, at this point we are just trying to see if we can get the CB Hello World Tutorial working.

... AND, please explain why we should not get the "traditional CB Specific" approach to work, instead of spending all this time/money on the MSys2 approach.

... in particular, if do this (http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_%28MSW%29), then how come we can't this (http://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Hello_world), particularly given the many results/tests etc we have submitted on that approach.



PS. as per usual the blog limits two achievements per post, so will need to add some posts for the entire collection of jpgs cited above.

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #18 on: April 13, 2016, 03:18:22 pm »
attachments 3, 4

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #19 on: April 13, 2016, 03:25:14 pm »
The blog is preventing the attachments/jpgs for some odd reason ... I'll try posting the jpgs later

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #20 on: April 13, 2016, 03:56:15 pm »
Please read the Wiki and Post a build log!!! In code tags. http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

EDIT: "Build Log" does NOT mean "Build Messages" Full means do a rebuild instead of build!

I do suggest that you give up; since posting a build log instead of a image is not possible for you; we do NOT want student to swamp this board with off topic questions and if the teacher can NOT figure out how to cut and paste a full build log then that is likely.

Edit2: I will try posting a new zipped project with troubling shooting output because learning to troubleshhot seems to be a forgotten art at most Colleges and other schools.
NOTE: This will NOT help me help you unless you can learn to cut and paste the full build log. So, if you fail after i post the new zipped project I will give up on you as a lost cause!!!!!

Tim S.
PS, I am NOT a CB dev; just someone losing my patience with a doctor who seems to be very smart and stupid at the same time!
« Last Edit: April 13, 2016, 04:13:03 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 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: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #21 on: April 13, 2016, 07:22:00 pm »
This is a build log like I am hoping you post. I broke mine into two part the pre-build steps I added to determine the problem and the normal output of a build log.

Edit2: Added new zipped CB Project.
I ran into an issue that looked like your issue; exiting out of Code::Blocks fixed the cause of my issue.

Tim S.

Code: [Select]
Running target pre-build steps
i686-w64-mingw32-g++.exe --version
i686-w64-mingw32-g++.exe (Rev5, Built by MSYS2 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
echo C:\Apps64\MSys2\mingw32\
C:\Apps64\MSys2\mingw32\
echo C:/Apps64/MSys2/mingw32
C:/Apps64/MSys2/mingw32
CMD /C where where
C:\Windows\System32\where.exe
CMD /C where sh.exe
C:\Apps64\MSys2\usr\bin\sh.exe
CMD /C "sh.exe -c 'which sed'"
/usr/bin/sed
CMD /C "sh.exe -c 'which wx-config'"
/mingw32/bin/wx-config
Code: [Select]
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler MSys2 MinGW64 32 bit)---------------

i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps64/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps64/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive  -c C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/Notes/MSys2/wx30Msys2/wx30Msys2App.cpp -o obj/Debug/wx30Msys2App.o
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps64/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps64/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive  -c C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/Notes/MSys2/wx30Msys2/wx30Msys2Main.cpp -o obj/Debug/wx30Msys2Main.o
i686-w64-mingw32-g++.exe  -o bin/Debug/wx30Msys2.exe obj/Debug/wx30Msys2App.o obj/Debug/wx30Msys2Main.o  -LC:/Apps64/MSys2/mingw32/lib   -pipe -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0 -lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  -mthreads 
Output file is bin\Debug\wx30Msys2.exe with size 796.98 KB
Process terminated with status 0 (0 minute(s), 9 second(s))
0 error(s), 0 warning(s) (0 minute(s), 9 second(s))
 

Deleted attachment because it is a waste of bandwidth to try to help this person we both speak English; but, we do NOT communicate.

If another person wants the code it is located here the OP never even tried this code; reason unknown, likely failure to communicate. https://github.com/stahta01/cb_misc/tree/master/Notes/MSys2/wx30Msys2
« Last Edit: April 14, 2016, 02:03:28 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: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #22 on: April 13, 2016, 09:17:14 pm »
Example of a Bad Build Log; I had to exit out of Code::Blocks
because some changes only take effect after restart of CB.
Code: [Select]
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g  -c C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.cpp -o obj\Debug\wx30Msys2App.o
In file included from C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.cpp:18:0:
C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.h:13:20: fatal error: wx/app.h: No such file or directory
compilation terminated.

After restarting Code::Blocks; I have been told by CB Devs
 that closing the project should be enough to fix this issue; but, it has never worked for me.
 The issue is the the value between backticks is never updated in CB.
A Good build log.
Code: [Select]
-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler)---------------

i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps32/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps32/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive  -c C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2App.cpp -o obj\Debug\wx30Msys2App.o
i686-w64-mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -IC:/Apps32/MSys2/mingw32/lib/wx/include/msw-unicode-3.0 -IC:/Apps32/MSys2/mingw32/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -mthreads -fpermissive  -c C:\SourceCode\OpenSourceCode\VC_Repos\Apps\IDE\Codeblocks\cb_misc-git\Notes\MSys2\wx30Msys2\wx30Msys2Main.cpp -o obj\Debug\wx30Msys2Main.o
i686-w64-mingw32-g++.exe  -o bin\Debug\wx30Msys2.exe obj\Debug\wx30Msys2App.o obj\Debug\wx30Msys2Main.o  -LC:/Apps32/MSys2/mingw32/lib   -pipe -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0 -lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  -mthreads 
Output file is bin\Debug\wx30Msys2.exe with size 796.98 KB
Process terminated with status 0 (1 minute(s), 39 second(s))
0 error(s), 0 warning(s) (1 minute(s), 39 second(s))

Tim S.
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 DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #23 on: April 13, 2016, 10:04:23 pm »
While we certainly do appreciate your extra effort, I am not sure if this is the best way to go about it.

Once again, and have asked many times, why is it that we can't simply get the "CB specific wx install" as per the CB pages, that accompany the CB tutorial for wx?   Why are we still, and ONLY, breaking our heads over a completely different approach via MSys2?  It is clear from the CB pages cited, that CB's "special wx make" approach is their required practice, and one that is, in a way, at odds with an MSys2 approach.

... perhaps we should switch to that, or involve somebody who is willing to do so.

Having said so, your last couple of posts are highly inappropriate, and out of line, and I add a comment in the P.S.

As a matter of courtesy, we performed yet another completely from scratch test based on your MSys2 approach just for you.  The build log:


-------------- Clean: Debug in wx30Msys2 (compiler: GNU GCC Compiler MSys2)---------------

Cleaned "wx30Msys2 - Debug"

-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler MSys2)---------------

i686-w64-mingw32-c++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g  -c E:\FORTRAN\CodeBlocks\wxHW30_5\wx30Msys2App.cpp -o obj\Debug\wx30Msys2App.o
In file included from E:\FORTRAN\CodeBlocks\wxHW30_5\wx30Msys2App.cpp:18:0:
E:\FORTRAN\CodeBlocks\wxHW30_5\wx30Msys2App.h:13:20: fatal error: wx/app.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))



If we close CB, re-launch, open project, and re-build, the build log:


-------------- Clean: Debug in wx30Msys2 (compiler: GNU GCC Compiler)---------------

Cleaned "wx30Msys2 - Debug"

-------------- Build: Debug in wx30Msys2 (compiler: GNU GCC Compiler)---------------

i686-w64-mingw32-c++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -I/lib/wx/include/msw-unicode-static-3.0 -I/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXMSW__  -c E:\FORTRAN\CodeBlocks\wxHW30_5\wx30Msys2App.cpp -o obj\Debug\wx30Msys2App.o
In file included from E:\FORTRAN\CodeBlocks\wxHW30_5\wx30Msys2App.cpp:18:0:
E:\FORTRAN\CodeBlocks\wxHW30_5\wx30Msys2App.h:13:20: fatal error: wx/app.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
 


... that's it, straight from CB's Build Log window.   There is no obvious place in CB that we could find that speaks of "pre build", and it's not on the page you cited either.  So, if you would like one of those, please be specific about creating one.

If there is another way to create build logs, please be specific about that, there is certainly nothing more than what we have done on the page you cited.


Finally, while we are happy to test a little more with this MSys2 strategy of yours, we really think that exploring that "CB official/specific" approach is worthy of attention, and wonder if you would speak to that.



P.S.  We will let it go this time, but you may wish to take more care before calling people "stupid".   We have been doing mathematical modelling and computational mathematics for many decades.  I am certain I could find an infinite number of computational problems, such as solving PDE's, stochastic calculus, differential topology, etc etc, where, even though you may have many years of programming experience, and higher education ...  you would not stand a chance, at least not without considerable assistance.

We have never seen wx before, we don't know anything about CB's "inards" and scripts etc, this is our very first go at creating a wx gui, and we can't even get CB to start the project, even for the "Hello World Tutorial" on CB's pages, in spite of following the instructions to the letter, and many times.

...  we don't think it is unreasonable to be able to get CB to do what it says it can do on its own pages.

... There is a very big difference between stupid, and uninitiated/inexperienced with a narrow/specialised technical subject.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #24 on: April 13, 2016, 10:07:28 pm »
Please download the CB Project that I wasted two hours to add the prebuild steps to.

http://forums.codeblocks.org/index.php/topic,21085.msg144058.html#msg144058

Tim S.
« Last Edit: April 13, 2016, 10:09:08 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 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: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #25 on: April 13, 2016, 10:15:27 pm »
Please state the type of wxWidgets library you are wanting to use?
Shared or Static?
wxWidgets version?

Are you planning to use Code::Blocks wxSmith to create the GUI for your students?

Remember I still NEED the output of the CB Project pre-build commands.

If you know how to use the wx-config command; please post the output from MSys2 Mingw prompt.

Code: [Select]
wx-config --list

My output
Code: [Select]
    Default config is msw-unicode-3.0

  Default config will be used for output

  Alternate matches:
    msw-unicode-static-3.0

Tim S.

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: 6538
    • My Best Post
Re: wxWidgets don't work
« Reply #26 on: April 13, 2016, 10:23:54 pm »
While we certainly do appreciate your extra effort, I am not sure if this is the best way to go about it.

Once again, and have asked many times, why is it that we can't simply get the "CB specific wx install" as per the CB pages, that accompany the CB tutorial for wx?   Why are we still, and ONLY, breaking our heads over a completely different approach via MSys2?  It is clear from the CB pages cited, that CB's "special wx make" approach is their required practice, and one that is, in a way, at odds with an MSys2 approach.

... perhaps we should switch to that, or involve somebody who is willing to do so.

Having said so, your last couple of posts are highly inappropriate, and out of line, and I add a comment in the P.S.

Please decide what you want to do.

You can give up using Code::Blocks; which I think might be best.
But, the fault is that Code::Blocks is NOT magic; it can NOT do what you tried to do.
But, with a little effort you might be able to do it; but, I have no idea what you really want to do.

I say again till you can get a CB Project to do what you want you will just be wasting time to try to get the wizard to do what you have no idea of how to do!

The CB windows way of using wxWidgets does NOT use wx-config that is MOST of your problem.
Code::Blocks also offers very poor support of CygWin which is another reason NOT to use it; MSys2 is a port of Cygwin.

Getting CB to use MSys2 debugging will likely be very hard to do; but, should be a little easier than getting a Cygwin debugger to work under CB.

Since, your post say you no longer want my help; I will do what you want and stop helping you.

Tim S.
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 DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #27 on: April 14, 2016, 01:10:50 am »
Dear Mr Tim.S

We were rather dismayed with your latest response. 

1) First and foremost, and very much in contradiction of your remarks, we have ALWAYS been CLEAR, and REPEATED at least SEVEN times, in virtually every post we have placed that our objective is to be able to do the CB wx TUTORIAL on this page (http://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Hello_world), on which there is link for installing wx for CB on this page (http://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_%28MSW%29).

Those posts, and those pages, and repeated various times, directly state the type of library required by the "CB instructions", and which we have noted may be at odds with the MSys2 approach that you are insisting on.

You have not on a single occasion commented in any way on those objectives or install, instead you have always restricted you attention solely to an MSys2 approach, and in spite of our repeated requests for you to consider the "official CB instructions/approach".  Have you ever even looked at those CB pages?

For you to say that you don't know what our objectives are rather speaks badly for your character.


2) Second, we have NOT ever asked you NOT to work on this matter, and again the facts contradict your remarks.  Though we have repeatedly, and virtually in every post, asked that you consider the "official CB approach", but which you have not.  Based on your comments, we can now only conclude that you are unwilling to do so.  Though we don't understand why you would not have just said so from the outset.


So, PLEASE have the good manners to ask one of the CB people/developers to respond ... as this type of "throwing us to dogs" seems decidedly unprofessional.



I will leave the MAIN points at that for now, but for the record just few of the additional matters include:

0) we have no idea what many of your other remarks mean, such as your reference to "our students", etc, nor why or where such ideas would come from.

1) It seems ridiculous to suggest that we do not use CB.  The entire OBJECTIVE here is to do the CB wx Tutorial.

2) You remark regarding MSys2 debugger etc are groundless and contradicted by the facts.  We have developed computational code, also Excel add-ins with CB/Fortran, and various other bits via CB/GTK/GTKExtra/GTKFortran etc.  The MSys2 debugger and ToolChain is actually the most up to date available to us, and it works very well in CB, even when debugging complex/mixed-language matters like Excel/VBA/Fortran/DLL's.

3) Clearly, it is possible to get wx to work in CB, as demonstrated by the TUTORIAL.  So, all we need is to figure out why the CB instructions need adjustment to work here.

4) It seems rather interesting that you would highlight just a portion of one of our posts, and "cheery picked" only a portion of our comments.  That, whether intended or not, is rather misleading.  For example, you don't see us cheery picking out your "stupid" statements etc.

5) We were willing to/and have put in a huge investment in your continued insistence on an "MSys2 only" approach, so long as that approach produced the objectives repeatedly stated.  Apparently, now that you are not willing or able to complete even that, you now seem to be posturing with dubious or imagined issues, so to fabricate an excuse to "throw us to the dogs".

... and so on.




Once again, PLEASE be so kind as to either provide a solution, for the now repeated ad nauseum times, to get us to be able to run the CB wx Tutorial ... or I suppose, given the nature of your responses and the character you have displayed recently, please have the good manners to ask someone at CB to provide the solution to allow this investment to complete.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2363
Re: wxWidgets don't work
« Reply #28 on: April 14, 2016, 01:20:18 pm »
So lets look if i can clear you up:
1) The wizard of c::b does NOT work with the current wx3.x installation without modifying. The reasons are because there are some highly complex naming conventions for wx libraries, and the current implementation of the script wizard is not build to handle this.
2) Don't try to modify the wizard script. My impression from your posts is that you are not experienced by compiling, because if you where, this thread would be finished after 3 posts... As stahta01 says here http://forums.codeblocks.org/index.php/topic,21094.0.html it will take some over thinking and probably some moths until the script is prepared for this and hopefully future wxWidgets versions
3) Sadly the wiki is not as up to date as it should be, so don't think that all instructions are cast in concrete. As i mentioned above wxWidgets uses a highly complex naming scheme so it is probably that the naming are different on your system.


Ok, if you want only to get a compilable project with wxWidgets, not really flexible, you only need some time to follow this steps:

Pre steps:
i have build wxWidgets with Msys. My configure command line was as follow:
Code: [Select]
../configure --enable-debug --prefix=../config_install
this command was executed in a  newly created "build_config" sub folder of the wxWidgets source folder. Then:
Code: [Select]
makeand
Code: [Select]
make installAfter this the config_install folder will have this structure:
Code: [Select]
  .
   |-bin
   |-include
   |---wx-3.0
   |-----wx
   |-lib
   |---wx
   |-----config
   |-----include
   |-------msw-unicode-3.0
   |---------wx
   |-----------msw
   |-share

NOTE: I don't copy or install this to the mingw base folder. I don't like to mix all kind of libraries, because this makes things a lot more difficult if something goes wrong (mixing versions, compiler ecc.)...

So lets create a project:
1) Start C::B
2) File->New Project->wxWidgets project
3) choose wx version 3.0.x
4) enter project title
5) select wxSmith and Dialog based
6) Let the wx location, it is not importand...
7) Finish the wizard.it does not really mater what you are using, we will overwrite it later
8) There will be warning messages, you can ignore them (answer with yes)
9) The wizard will now create a project and it will NOT COMPILE
We will now set up the project:
10) Project->Build options
11) Select the top most item in the left tree view
12) Search directories-> Compiler
      a) Delete all entries
      b) Add entry-> Browse to your "config_install\include\wx-3.0" folder NOTE: this folder can have a other name on your system, like "config_install\include\wx-3.1" or "config_install\include\wx-3.0u", but i hope you get the idea what folder i mean...
      c) Add entry-> Browse to your  "config_install\lib\wx\include\msw-unicode-3.0" folder
13) Search directories -> Linker
      a) Add entry->Browse to your "config_install\lib" folder
NOTE: There will pop up many error messages "You have changed some settings. Do you want these settings to be saved?" Hit always "yes"
14) Linker Settings->Link libraries
      a) remove all libraries
     b) Add->Browse to your  "config_install\lib\" folder, select your "libwx_mswu_core-3.0.dll.a" NOTE: This file can have a other name on your system!! You need to select the file with "core" in it. OK->Use absolute paths-> Remove the path to only have the library name
     c) Add->Browse to your  "config_install\lib\" folder, select your "libwx_baseu-3.0.dll.a" NOTE: This file can have a other name on your system!! You need to select the file with "base" in it. OK->Use absolute paths-> Remove the path to only have the library name
15) In the Tree view on the left select "Debug" target
      a) Linker Settings->Link libraries-> remove all libraries
16) In the Tree view on the left select "Release" target
      a) Linker Settings->Link libraries-> remove all libraries
17) Hit OK
18) Build->Build and Run

This should create the "Hello world" example and it will run...
This is the simplest project. If you use some more complex ui elements you have to add the libraries under "Linker Settings->Link libraries"
If you update wxWidgets this project won't compile any more, because the names will probably change.
If you want a more flexible way, and templates for your projects use stahta01's template project. He uses a more general way, but it will add some complexity

This is a general tutorial. If you compiled wxWidgets with Msys, mingw or cygwin should not matter... Just use the --prefix options on the configure step so you KNOW where the libraries and include directories are... If you don't use the configure step, but the general makefile the instructions are similar, you just have to know where the libraries are and modify the paths accordingly...

I hope this will clear things up. If you have some problems compiling post a "FULL REBUILD LOG"

Offline DrOli

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxWidgets don't work
« Reply #29 on: April 15, 2016, 04:34:21 pm »
Many thanks for the detailed notes. 

Though, first, it seems obligatory to add that your comment about us not knowing about compiling is specious.  In fact, the approach you have described is the exact approach we take with each and every project we have build since all of our project interlace many bits like C, Fortran, GTK, GTKExtra, PLPlot etc.  Therefore, it is a necessity and standard practice for us to be setting many compiler/linker/search dir's libs etc etc for every project and target.  We are confident that had your approach to circumventing the wizard been provided at the outset, we would have succeeded a very long time ago.

The problem here is NOT with compiling, but with:

1) As you have recognised, though in our view with spectacular understatement, the CB notes on the web certainly contribute to the confusion and clearly are self-inconsistent with the approaches offered on the forum pages.

2) However, by far a bigger problem is the "wx Wizard", as it relies on much specialised and internal machinery that certainly creates and exacerbates problems, and that has nothing to do with "compiling", but a lot to do with proprietary CB machinery.  Much time was spent dealing with what you now describe as will require many months of development work to get corrected.

3) The earlier suggestions for us to edit the Wizard were really sub-optimal and it seems a cul de sac.  The entire Tim.S "wx-config" approch, while it may, given enough time, be the strategy that the CB Wizard re-write may use etc, is MUCH too complex, much too delicate, and has far too many bits that require highly specialised knowledge of a very narrow matter.  It is certainly not an approach that should be recommended to any body other than seasoned specialists in that specific narrow area.

The best practical solutions, from our perspective, are provided below, with or without the wizard.


Now, GOOD NEWS:

1) We have figured out how/why to get both wx2 and wx3 working, from either a classical Msys install, or via the "CB specific" install.

Though, we can get the "full CB/wxWizard" approach to work only with wx2 and the CB specific "make" approach, and then with some adjustments.

All the other variations require circumventing the wizard via a process similar to, but not exactly as per, your instructions. 

All of the working results require some extra details, some of which are provided below.

That we had suspected from the outset, and as you have just recently confirmed, wx3 does NOT work with the Wizard (and as you say will require months of dev time) is a little annoying.  Had that point been made immediately at the outset, much time and agro would have been saved.  Similarly, had there been fewer "inconsistencies" on the CB pages for "monolithic" etc, that too would have saved much confusion, etc.

... it would seem pressing to put a short, but prominent, CAVEAT on the CB pages regarding such points.


2) Regarding some issues to get things working:

a) The wx install process has a number of idiosyncrasies, and especially its reliance on unorthodox Dir structure/location of files.  The most frequent error that arose in the many days we have spent on these matters is the compile crashing on "can't find wx/setup.h".  There are many setup.h's in the wx include/ sub dirs, but NONE in "wx".  That wx3 adds the extra dir "layer" /wx-3.0 very much exacerbates the issues, and also may be a key reason why CB's Wizard requires a re-write.

There are two important points that may help many:

(i) The "ACTUAL" setup.h that is required is, based on wx's "design", is actually located in ..\lib\gcc_dll\mswu\wx  ( NOT ..\include\wx...).  That one bit of information would have saved us many many hours.

(ii) Another important wrinkle is the "ORDER" in which paths etc are placed in the Search Directories etc in CB.  The Wizard, and variations of your approach will CRASH, even if the Search Dir have ALL the correct paths stated, but in the wrong order.  For example, when it searches for setup.h, if the first path does not include it, it may crash (i.e. need to use those little up/down arrows in the Search Dir dialog). 


b) Some of the instructions on CB pages are inconsistent.  For example, the make instructions are for unicode, but the TUTORIAL fails to show in its images/notes that in the Wizard that one must select/enable the unicode option in the Wizard.  Otherwise, one obtains some cryptic errors which are difficult to debug, and takes a little time to observe that if it is complaining about "Chars", but the make was Unicode, then its a Wizard/unicode/ansi "collision".

c) In your instructions, the "../configure --enable-debug --prefix=../config_install" fails with "configure: error: expected an absolute directory name for --prefix: ../config_install".  That could be a Unix vs. MSys thing.  We simply changed the build to a traditional MSys approach, and altered the names/paths as appropriate to test your instructions (though keeping point b) from above in mind).

d) We are not sure why, but the choice of ToolChain makes a difference.  On our system, we have two completely independent MinGW infrastructures:  One based on a somewhat traditional MinGW, where we build everything from scratch, and also an MSys2 install with all of its pre-built packages.  We had switched to the MSys2's Toolchain for compilers/debuggers since they are more recent compared to the MinGW-64 independent toolchain, and that works much better for all our C/Fortran/GTK etc projects (in fact bugs in GDB < 7.11.1 cause various type crashes for particular situations in CB, as reported elsewhere)

However, for these wx matters, some of the problems seemed to be due to "mystery" issues with the MSys2 Toolchain.  Those problems went away when we reverted (just for the wx testing/projects) to the classical Toolchain in MinGW GCC.  Ultimately, this could be a "path thing", but haven't proven the cause yet.

e) The choice whether to use .PCH or not impacts matters in various ways, and can lead to various compile issue, adding to the confusion.

f) The installation of wx 2.8.11 via the "CB specific" make instructions require a little jiggery pokery on windows < Win7/Sp1.  We can post our "fiddling" to make that work, let me know.

g) The CB instructions may wish to include a comment about the "j" switch, as it can massively increases speed of the, otherwise ponderous, make process on multi cpu machines.

h) The CB instructions for use with wx 3.x, for us, required adding CXXFLAGS=-std=gnu++11 to the make instruction (NOTICE, it MUST BE gnu++11, NOT c++11, this is some wx specific idiosyncrasy)

i) BTW, in your instructions, the example is for "Dialog", while the Tutorial is for "Frame", we assume that is purely incidental/context specific.  If there is more to that, please explain.

... various other minor matters for another time.



So, while it took two-man-weeks of fiddling to get CB/wx to work, once working it required only an hour to build a simple wx spreadsheet app, without any previous wx training ... very cool :-), we will test further to compare wx to Tcl and GTK.



3) A few questions:

a) Is there any specific reason why the CB wx instructions are for "release" only?

b) Is PCH always recommended for wx projects?  Perhaps a few words on the pros/cons may be helpful.

c) Is a "static" variation of all this possible/advisable?  For example, to simplify the distribution of apps produced (not sure about licensing implications??).

d) Is unicode necessary?  Perhaps a few words on the pros/cons may be helpful.

f) Perhaps a few words on the pros/cons of the "monolithic" wx approach vs. not may be helpful.


Many thanks

DrO