Author Topic: How to run c++ program in code block?  (Read 990 times)

Offline rahul.6sept

  • Single posting newcomer
  • *
  • Posts: 1
How to run c++ program in code block?
« on: January 21, 2019, 05:49:50 pm »
Dear all,

     I'm new to code block. I want to run c++ program in this.

  I went to setting - compiler - added clang compiler. But it shows error msg " Can't find compiler executable in your configured search path's for GNU GCC Compiler".

 Kindly guide me.

 Regards,

 Rahul
 
« Last Edit: January 21, 2019, 05:52:33 pm by rahul.6sept »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2290
Re: How to run c++ program in code block?
« Reply #1 on: January 22, 2019, 02:09:32 pm »
You have to select the right compiler for your project:
Project->Build options->select the the project name on the left->Select your clang compiler from the dropdown list

Offline ishan c++

  • Single posting newcomer
  • *
  • Posts: 1
Re: How to run c++ program in code block?
« Reply #2 on: January 26, 2019, 04:46:24 am »
my compiler can't load, what should i do?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2290
Re: How to run c++ program in code block?
« Reply #3 on: January 26, 2019, 12:50:33 pm »
Quote
my compiler can't load, what should i do?
Is not a error message or error description.
You do not say what does not work or load, how this manifests and what the problem is.
Without detailed error message, procedure how to trigger this error, your tries to fix it, and more information about your environment we can not help...

Offline rcttsoul

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: How to run c++ program in code block?
« Reply #4 on: March 01, 2019, 09:41:58 am »
what is happening to all these people is that they are downloading the CodeBlocks/MinGW package, it is jacked up as I ran into this same problem and took me 5 hours to figure it out, I found these videos on YouTube that helped me fix my problems and how to properly install both MinGW and CodeBlocks.
as the bundle download is messed up, and the install instructions are incorrect and lacking information, it is causing all these people to have the same problem.
Discord = Pryor#2941

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #5 on: March 01, 2019, 06:14:33 pm »
so, I'm getting 
Quote
The compiler's setup (Intel C/C++ Compiler) is invalid, so Code::Blocks cannot find/run the compiler.

But I'm not even using the intel compiler. I'm using gnu g++ from the MinGW package which is auto recognized by C::B but still "no-go" any guesses why?

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #6 on: March 01, 2019, 06:30:09 pm »
what is happening to all these people is that they are downloading the CodeBlocks/MinGW package, it is jacked up as I ran into this same problem and took me 5 hours to figure it out, I found these videos on YouTube that helped me fix my problems and how to properly install both MinGW and CodeBlocks.
as the bundle download is messed up, and the install instructions are incorrect and lacking information, it is causing all these people to have the same problem.
  With that confirmation, I do believe i'm going to uninstall and re-install both separately and see if that helps. Wish me luck!

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #7 on: March 01, 2019, 07:07:22 pm »
no such luck :-[  Now, instead of looking for the intel compiler, it's looking for Cygwin. can someone please shoot me? :-\

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #8 on: March 01, 2019, 07:09:24 pm »
I'm starting to think the only thing that will fix this is Del C:/*.*  :'(

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #9 on: March 01, 2019, 07:29:42 pm »
I went through and uninstalled/deleted everything to do with C::B MinGW and Cygwin. going to try one more time with a completely fresh install  ::)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2290
Re: How to run c++ program in code block?
« Reply #10 on: March 01, 2019, 07:47:45 pm »
You get this error message probably because you have set the intel compiler as default.
To fix this go into Settings->Compiler->Select the mingw gcc compiler from the drop down list->set as default (there should be a button to press)->Close dialog with Ok
Now all new projects should use gcc as default

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #11 on: March 01, 2019, 07:59:12 pm »
I think I must be on some hidden camera show or something... I'm getting Punk'd...


Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #12 on: March 01, 2019, 08:00:48 pm »
I just did a full clean install of Codeblocs and MinGW.... surprise surprise... Still nothing! >:(

Offline RyanR

  • Multiple posting newcomer
  • *
  • Posts: 11
  • I'm just here to learn.
Re: How to run c++ program in code block?
« Reply #13 on: March 01, 2019, 08:12:25 pm »
https://sourceforge.net/projects/mingw-w64/
https://sourceforge.net/projects/codeblocks/

are these not the right ones???  I don't know what I'm missing here... It has to be something random in the compiler congiguration or... I don't even know.

Offline rcttsoul

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: How to run c++ program in code block?
« Reply #14 on: March 01, 2019, 08:39:08 pm »
https://sourceforge.net/projects/mingw-w64/
https://sourceforge.net/projects/codeblocks/

are these not the right ones???  I don't know what I'm missing here... It has to be something random in the compiler congiguration or... I don't even know.

first uninstall Codeblocks mingw bla bla, the Codeblocks MinGW bundle download is messed up.
Now install MinGW separately and first... https://osdn.net/projects/mingw/releases/
Now download and install Codeblocks ONLY .. http://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Windows/codeblocks-17.12-setup.exe

And here are some videos that will actually show you the secrets on how to..... set everything up shhhhh
setup of MinGW https://www.youtube.com/watch?v=sXW2VLrQ3Bs&t=249s
setup of CodeBlocks https://www.youtube.com/watch?v=c8iq3yg6RDM&t=8s
Discord = Pryor#2941