Author Topic: Installing Code::Blocks with mingw on Windows 10  (Read 16904 times)

Offline techied

  • Single posting newcomer
  • *
  • Posts: 3
Installing Code::Blocks with mingw on Windows 10
« on: April 04, 2016, 05:11:49 pm »
Hi all.

This is a general question which I intend to find a response to and then to post on our university forum for a course in introductory C programming.

Many users have experienced problems when installing Code:Blocks with mingw thus failing to run or compile any source code written.
(version 16.02 mingw binary installer)

Does anyone have generic set of instructions I can carry over to the University home page for the course and my fellow students there?

Thanks in advance.
Much excited to start using Code:Blocks for this educational purpose.

/Mike "Techie Dude" J.
« Last Edit: April 04, 2016, 05:14:13 pm by techied »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #1 on: April 04, 2016, 10:42:59 pm »
1) Download http://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw-setup.exe
2) Double click on the downloaded file and install codeblocks with mingw
3) Start codeblocks
4) create a new project project, without spaces in the name and some non ASCII characters (this is not difficult, and helps your it live a lot... it has partially to do with legacy and cross platform things, short: please use only ascii and non spaces for your paths and filenames)
5) Add some code and hit compile and run...
6) If you get a black cmd window: disable anti virus software

If there is some problem with the compiler try:
Settings->Compiler->Selected compiler: gnu gcc compiler -> Toolchain executables-> Auto-detect->OK

if this  throws errors:
Settings->Compiler->Selected compiler: gnu gcc compiler -> Toolchain executables->Compiler's installation directory: $PATH TO CODEBLOCKS INSTALLATION $\MinGW -> Ok

tips:
# Always use projects...
# if you don't know what you are doing don't install multiple compiler in parallel (for example installing the file from 1) and installing a second mingw compiler by yourself)
# Don't use spaces and non ascii characters in your paths (codeblocks installation path, or your project paths/files)
# disable your anti virus software, and start brain.exe. (anti virus software is useless ;) )

honestly: If you go to the university, make some IT lecture and you can't install a "simple" program like codeblocks, i would recommend hours of noob computer courses and not the university...

if there are really "a lot" user that experience problems, maybe you can summarize them and post them here, because i really have no idea what could go wrong with this steps...

linux is simply download the rigth repo, or add a ppa and install them see: http://codeblocks.org/downloads/26#linux maybe you have to install binutils and gcc to start (i don't know really, but this is easy done with "sudo apt-get install binutils" and ""sudo apt-get install gcc"

For mac user the thing is a bit more difficult... I am no mac user and so i can't help...

greetings
« Last Edit: April 04, 2016, 10:46:59 pm by BlueHazzard »

Offline tigerbeard

  • Almost regular
  • **
  • Posts: 186
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #2 on: April 05, 2016, 03:55:19 am »
if beginners come from MS Visual Express, they might be surprised to be confronted with libraries and search paths? If here are no libs included then will happen exactly what techied described: compile and run will fail.
As I do not use the installer with MinGw I do not know if it sets up the standard libs and the search paths. If it does not, I agree that this could be quite an issue for new comers.

I would add to the tips:
 #Step one after installation should be: File/New/Project: Then select and run the Wizard "console application". This should compile and run a "HelloWorld" correctly.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #3 on: April 05, 2016, 10:02:48 am »
This is a configuration issiue and you face it also in msvc if you use a third party library... In msvc it is even more complicated (at least for me).
If you search some "general" tips how to install 3th party libs:  http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F

Generally the faqs are helping...
Greetings

Offline techied

  • Single posting newcomer
  • *
  • Posts: 3
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #4 on: April 05, 2016, 12:00:59 pm »
One recurring issue seems to be the UAC of Windows.
One should always right click and run the application as administrator to avoid bugs.
Also at install time!

Thanks a lot from myself and my fellow students.
/Mike J.
« Last Edit: April 05, 2016, 12:05:18 pm by techied »

Offline tigerbeard

  • Almost regular
  • **
  • Posts: 186
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #5 on: April 05, 2016, 03:34:52 pm »
@techied Great that your questions were answered.


@BlueHazzard: just allow me a comment. I think the point is "if" you use a 3rd party lib, whereas I think newbies typically don't. Most want to learn programmig not setting up build environments. MS makes it easy since you are confronted with libs and all that not before you are ready to need 3rd party libs. Most newbies tended to run into opengl as their first external lib in earlier days, maybe today thats different. I am convinced that this is the number one reason that most newbies do not stick with CB when trying it out. That is sad, because if you know its so easy. But if you don't know its sooo hard. Because almost everything else became really simple since a couple of years ago. I came from VC6 to CB and remember very well how difficult that felt (even when I had been using 3rd party libs for a long time). I fully agree, I had been cursing their terrible GUI with the compiler settings all the time. However, complexity and defaults are two different things.
This is a configuration issiue and you face it also in msvc if you use a third party library... In msvc it is even more complicated (at least for me).

Offline UrsBucher

  • Single posting newcomer
  • *
  • Posts: 2
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #6 on: June 02, 2020, 07:22:17 am »

Hello,
A university student here. Can I use mingw64 on Windows 10 to compile mbedTLS libraries? My Code::Blocks is 32-bits though. Can I create two compilers settings in Code::Blocks?

Offline UrsBucher

  • Single posting newcomer
  • *
  • Posts: 2
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #7 on: June 02, 2020, 07:22:32 am »
Also: where can I learn more about 3rd party libraries and the tips for beginners? Thank you beforehand.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Installing Code::Blocks with mingw on Windows 10
« Reply #8 on: June 02, 2020, 09:21:30 am »
Quote
Can I use mingw64 on Windows 10 to compile mbedTLS libraries?
You have to ask the guys on mbedTLS to answer this question

Quote
My Code::Blocks is 32-bits though
And? There are also 64bit releases out there

Quote
Can I create two compilers settings in Code::Blocks?
You can create unlimited compiler settings in codeblocks

Quote
where can I learn more about 3rd party libraries and the tips for beginners?
Youtube, http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F
and generally http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)

Then, why do you pull out a old topic that is completely  unrelated to your questions? Create a  new topic for your questions.
Also learn to ask smart questions. You will not get any significant answer with broad questions like the one above. We can not know what you want to do and for this what you need....