Author Topic: Update wiki directions to 3.0.4 for build C::B  (Read 814 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6548
    • My Best Post
Update wiki directions to 3.0.4 for build C::B
« on: February 08, 2019, 11:19:18 pm »
Good or bad idea to update wiki direction to using wxWidgets version 3.0.4?


http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux

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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2370
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #1 on: February 09, 2019, 01:29:26 am »
I think the wiki should be updated to use the system default wxWidgets installation. Does something speak against it? I mean every up to date distro has  a wxWidgets that should work with codeblocks, without compiling it by our self, why bother the user with the whole process to compile and install it?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11821
    • Travis build status
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #2 on: February 09, 2019, 11:46:03 am »
Yes, the native lib should be preferred. Everything else causes problems to novices.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rcttsoul

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #3 on: March 01, 2019, 04:41:52 pm »
The ENTIRE wiki needs updated, not even the instructions for a Windows install is wrong.
Discord = Pryor#2941

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6548
    • My Best Post
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #4 on: March 02, 2019, 09:18:16 pm »
The ENTIRE wiki needs updated, not even the instructions for a Windows install is wrong.

So, the Windows install directions is correct?

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11821
    • Travis build status
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #5 on: March 02, 2019, 09:38:34 pm »
@rcttsoul:
Good, but can we get back to constructive criticism, please?
Saying that something is totally wrong and should be re-written from scratch is not constructive, not has a good chance of success.
But saying something like :
Quote
I've followed the instructions on page X. They don't work. Step3 is totally wrong. You should add these steps between step 2 and step 3.
is a lot better and there is a chance that someone would do something to improve the situation.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Nohbdy

  • Single posting newcomer
  • *
  • Posts: 2
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #6 on: March 17, 2019, 11:50:49 pm »
I am currently in the process of following this wiki myself. I am midway through but I thought I might bring some info on my process so far and how it might help the wiki. Also, just my own recommendations. Note that I am a sort of hybrid newcomer in that I am sometimes just as confused as can be, but I also have some awareness and light know-how of when to dig deeper, use certain tools or use alternatives, etc.

Firstly, I'd simply recommend an alternative to direct links to specific versions, or at least saying something akin to "At the time of this writing([date]), the link is: ". Primary confusion right now for me is under Prerequisites->wxWidgets, where it says "Download: wxMSW-2.8.12.zip". In my perspective, here are my thoughts when reading:
- Initially, I assume I will be downloading the newest wxWidgets from the official site. Noticing this other download link of an older version makes me question some things though:
-- I see "For more information, go here". Since it is not telling me to go here explicitly, I slightly question the idea of getting the newest version.
-- I see the "Download: wxMSW-#.#.#.zip". As an absolute newcomer I would assume this is the entire wxWidgets, it's everything I need - I would probably download this and move on. However, I've already downloaded the freshest version, and I see this is nowhere near the same filename..
--- I now think: Okay, maybe I just also need this file..
--- I also think: But... maybe I should find the freshest version of this wxMSW thing..
--- I also think: But... maybe this is an indication that I need specifically this wxMSW version... will that work with the newer wxWidgets I intend to use?
--- I also think: No wait, perhaps I not only need this older wxMSW, but I need the matching, older wxWidgets. Hmmm...

Ah but wait forgive me, I've skipped the MinGW installation. I have a properly working Code::Blocks already(binary download + mingw. I opted not to use a nightly build, as I tried that once and it nearly seems more confusing than the process on this page), so the "MinGW Installation" link seems redundant. However, little do I know that the MinGW will be used to build wxWidgets itself! This in itself leads to a few problems, but perhaps this is my fault due to how I went about it:
- I go to download the freshest MinGW. If I was an absolute newcomer, I may accidentally download the old MinGW rather than the one at https://mingw-w64.org/ - as the old appears prominently first via Google search.
- I see that the "Downloads" page has a "Win-Builds". I am using Windows, so absolute-newcomer me might have went straight for this. However, I actually see that choice is using much older versions! Thankfully, I not only see "Msys2" has the freshest versions possible, but I've actually used it before(Failed attempt at doing this, or a nightly, years ago :P)!
-- As Msys2 seems definitely the best way to go for a Windows user, I take this path...
-- When performing an initial pacman -Syu as recommended in other guides, I feel things are on the right track!
(Some skipping around here, sorry. Figuring this part out took a while, not sure how to fully explain hehe.)
-- I figure out the TortoiseSVN usage and get the source code easily!
-- I am now trying to build wxWidgets as per the "Installing Code::Blocks from source on Windows" wiki:
--- The "Configure Build Options" section is clear. Perhaps if I was newer I'd be bewildered here, but for me I finally understand sometimes you just gotta edit a text file. (This is actually kinda hard to grasp at first coming from Windows GUI world). I copy and paste the build options I want(just silencing warnings) properly. This section explains things fine.
--- The "Build wxWidgets Library" part causes me pain, but after some time, I realize that Msys2 did not only need pacman -Syu. When you enter pacman -F, it says something about MinGW stuff not a part of the database or something. Without a Google search nor a guide, I realize I must also enter pacman -Fy. Now I can finally build wxWidgets.


Anywhoozle, I'm at that point right now so I'll edit or post an update of any other snags I come across. Obviously much of the pain was on the MSYS2 and MinGW side of things. It is also confusing in Msys2 land because it seems to already "have" MinGW, but.. perhaps not the latest unless you explicitly get it? Also, through MSYS2 I noticed I could simply download wxWidgets(pacman -S mingw-w64-x86_64-wxWidgets), alas it is not clear if this would work out fine with building Code::Blocks, and I've yet to deal with the wxMSW portion so I'm unsure if that also needs a separate download(and if it can be done via MSYS2 since it's starting to feel like quite a nice hub for doing all this stuff).

UPDATE: I now understand that wxMSW is the windows installer. Well, that clears up that(might edit the above later to remove those mentionings - however the point was kinda how confusing it looks as a perspective).
It also looks like mingw-w64-x86_64-toolchain is the package to get for the installation steps. I seemed to have downloaded a myriad of other packages or something, but this one appears to be the one that even activates the ability to use mingw32-make. On a related note, online you will find discussions on how mingw32-make and make are... I have no idea actually. Basically, a new user might be told to just use make over mingw32-make, however in MSYS2 this causes it to just hang there, requiring ctrl+C to exit whatever the fudge it's doing(Note: ctrl+C to cancel these things - other than being confusing with copying on Windows - is yet another piece of knowledge an absolute newcomer will likely know nothing about.)

UPDATE2:
- Newest development version of wxWidgets BUILT successfully, but building steps from within Code::Blocks failed (popen and pclose not defined). Going to try the link in wiki verison.
- "wxMSW-2.8.12.zip" version failed during build ("loses precision" cast errors). Going to try latest "stable" wxWidgets..

UPDATE3: Nevermind, getting a Nightly Build is far easier! I still refuse to give up on the Self-Hosting option(that's the correct term, right?), but I will use the nightly CodeBlocks to do so next time. I feel I may have to still experiment with the correct MinGW and possibly wxWidgets.
« Last Edit: March 19, 2019, 12:54:45 am by Nohbdy »

Offline sodev

  • Regular
  • ***
  • Posts: 294
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #7 on: March 19, 2019, 07:52:50 pm »
I don't understand two things:
  • Why do people have so much trouble building wxWidgets and CodeBlocks
  • Why do people who can barely turn on a computer think they need to code C/C++

The title of this thread sounds generic, the first post targets linux, but the last reponse targets windows, so i contribute to this confusion and give a small heads up for the windows side. I am self building wxWidgets and CodeBlocks for around 10 years now and did never face (or at least can't remember having faced them in the recent past ;D) these strange problems i have seen in this thread and others.

A small note for the Linux side, there it usually boils down to figure out which system packages are missing, and yes, this is sometimes not so easy, until configure doesn't complain anymore. Now to the Windows side.

Building wxWidgets
Requirements:

CodeBlocks is designed to work with wxWidgets build with the pre-generated Makefiles (sadly from the time before they version-tagged the output, but this can be easily fixed). I refuse to use a POSIX-Environment (MSYS2) to build stuff on Windows so i use a plain MinGW-w64 installation. The wxPack script makes it easier to build all the different flavors of wxWidgets, i use a slightly extended version mainly to build the samples and wxrc and to adapt some settings for MSVC builds, for this the version from github is sufficient, you just need to adapt the paths to your MinGW-w64 installation (details follow). I always build the master branch of wxWidgets from Github, so just clone that repository.

  • Install MinGW-w64. I still do 32 Bit builds so as of now i have Version 8.1.0 with POSIX threading and DWARF exception handling. Use the 64 Bit version if you prefer.
  • Clone the wxWidgets repository
  • Copy the file
    include\wx\msw\setup0.h
    to
    include\wx\msw\setup.h
  • From the wxPack repository copy the files
    wxBuild_wxWidgets.bat
    wxBuild_Bakefile.bat
    wx_no_3rd_party.bkl
    into
    build\msw
    of the wxWidgets source tree
  • Adjust the paths in wxBuild_wxWidgets.bat to match your MinGW-w64 installation, for me it looks like this:
    :: MinGW4-w64 Gcc install location. This must match your systems configuration.
    set MINGW4_W64_DIR=C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32
    set MINGW4_W64_GCC4VER=81
  • Because of issues with the Makefiles still present you have to create the following directory structure in the lib directory yourself:
    gcc81_dll\mswu\wx\msw
    gcc81_dll\mswud\wx\msw
    gcc81_lib\mswu\wx\msw
    gcc81_lib\mswud\wx\msw
  • Open a windows shell in build\msw and start the build script. CodeBlocks needs only one version of the library so build at least this one (adapt properly to build a 64 Bit version):
    wxBuild_wxWidgets.bat MINGW4_W64 NULL DLL_RELEASE_MONO_UNICODE
  • Rename the output directories by removing the version number from them, CodeBlocks won't find them with it

Building CodeBlocks
Requirements:
  • http://svn.code.sf.net/p/codeblocks/code/trunk
  • A working CodeBlocks installation (Nightly, Release, whatever)
  • zip.exe (can't remember where i got it from), svn.exe (install TortoiseSVN with command line tools) and strip.exe (from your MinGW-w64 installation) in your system path (see Wiki)

I am building CodeBlocks with CodeBlocks, this is the easiest approach. You need to do some small setup in CodeBlocks and prepare an output directory. Right now i am building against wxWidgets 3.1.x so the paths reflect that.

  • Checkout (or Clone some Git mirror) of the CodeBlocks repository
  • Create the directory src\devel31
  • Copy all DLL files of the bin directory from your MinGW-w64 installation into that directory
  • Copy your build wxWidgets DLL (something like wxmsw313u_gcc81.dll) into that directory
  • In CodeBlocks create the Global Variable cb_release_type with its base member set to -O2
  • In CodeBlocks create the Global Variable wx31 with its base member set to the root directory of your wxWidgets repository clone
  • Open the CodeBlocks_wx31.workspace, make sure the target All is selected and hit the compile button
  • Open the ContribPlugins_wx31.workspace, if you don't have Boost on your system select the NassiShneiderman plugin and remove Windows from the build platforms, otherwise define the proper Global Variable, select Build Workspace from the menu
  • Open a windows shell in src and run update31.bat
  • Now you have a full CodeBlocks package in output31 that you can copy, zip, whatever you like to do with
« Last Edit: March 20, 2019, 07:36:24 pm by sodev »

Offline tigerbeard

  • Multiple posting newcomer
  • *
  • Posts: 89
Re: Update wiki directions to 3.0.4 for build C::B
« Reply #8 on: March 20, 2019, 11:48:13 am »
I don't understand two things:
  • Why do people who can barely turn on a computer think they need to code C/C++
Because they don't  ;).
You might agree that even world leading coding experts can be easily confused by being thrown into a different corner of the IT world where they are confroned with things they have never used before or heard of before.
Everything gets trivial after doing it for a while. But I get humble when I look at my own notes taken when starting to use Linux. I can't believe the stuff I had trouble with :-[.

For open source projects I believe the hardest challenge is to write up documentation suitable for all levels of experience. Often a lot harder than coding stuff. So I think we should appreciate and value all feeback we can get.

For me both posts @sodev and @Nohbdy have good value and are constructive and I'd love to read more.