Author Topic: Build and run doesnt work and colours dont appear  (Read 28083 times)

Offline Just_A_Guy

  • Single posting newcomer
  • *
  • Posts: 6
Build and run doesnt work and colours dont appear
« on: September 04, 2011, 01:16:42 pm »
Hello all :),

I have recently downloaded the new version of Code::blocks (10.05) but it doesnt seem to work.
I downloaded the codeblocks-10.05mingw-setup.exe (binary release).
http://www.youtube.com/watch?v=W4_UHtzYoIQ (from 1:00 to 1:38)
I dont see any colours when i type the SAME words.
So when i type like: #include <iostream> it doesnt get green.
And when i press Build and Run it also doesnt do anything.
I have Windows 7 64 bit.
Help?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Build and run doesnt work and colours dont appear
« Reply #1 on: September 04, 2011, 05:43:10 pm »
It sounds like you do not have a project open... if you require detailed instructions on project creation/maintenance, refer to this wiki page.

If in fact you do have a project open, it is possible you disabled the required plugins during installation.  If this is the case, reinstall Code::Blocks, ensuring all the plugins are included.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: Build and run doesnt work and colours dont appear
« Reply #2 on: September 04, 2011, 06:22:20 pm »
Do you have a file with a correct file-ending, so C::B which lexer should be used for highlighting and which compiler for compiling ?

Offline Just_A_Guy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Build and run doesnt work and colours dont appear
« Reply #3 on: September 05, 2011, 08:01:52 am »
It sounds like you do not have a project open... if you require detailed instructions on project creation/maintenance, refer to this wiki page.

If in fact you do have a project open, it is possible you disabled the required plugins during installation.  If this is the case, reinstall Code::Blocks, ensuring all the plugins are included.
Ok i can see the colours now.
I reinstalled Code::Blocks with all plugins included, but still the option Build and Run doesnt work.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Build and run doesnt work and colours dont appear
« Reply #4 on: September 05, 2011, 03:42:10 pm »
I downloaded the codeblocks-10.05mingw-setup.exe (binary release).
From this I assume you have a compiler installed.

I reinstalled Code::Blocks with all plugins included, but still the option Build and Run doesnt work.
When you say that it does not work, do you mean that the button is grayed out, and you cannot click it, or that when you press it nothing happens (check the build log at the bottom of the screen in Code::Blocks)?
 * If it is grayed out, it is because the file you are working with does not have the correct file extension - .cpp - as jens already mentioned.

http://www.youtube.com/watch?v=W4_UHtzYoIQ (from 1:00 to 1:38)
I took a look at the this video, and if you are following its instructions, you do not have a project setup.  Although beginning exercises can be done like this, to do anything more complex, you will need to setup a project.  If you have not already, I will again recommend you read this wiki page.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: Build and run doesnt work and colours dont appear
« Reply #5 on: September 05, 2011, 07:35:21 pm »
On windows, you might need to scroll the BUild log, to see the output.
Their seem to be sometimes refreshing issues with wxWidgets on windows.

Offline Just_A_Guy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Build and run doesnt work and colours dont appear
« Reply #6 on: September 05, 2011, 08:27:26 pm »
On windows, you might need to scroll the BUild log, to see the output.
Their seem to be sometimes refreshing issues with wxWidgets on windows.
I dont get it? You mean i need to select the output that works on windows 7?
Quote
When you say that it does not work, do you mean that the button is grayed out, and you cannot click it, or that when you press it nothing happens (check the build log at the bottom of the screen in Code::Blocks)?
 * If it is grayed out, it is because the file you are working with does not have the correct file extension - .cpp - as jens already mentioned.
No its not grayed out, i can click on the option but it doesnt pop up something. So i click on Build and Run, but nothing happens.
And yes i have made a project and saved the file on my desktop (it's a C++ source file (.cpp) )
But i will check that page again.
(Sorry guys, im not pro at English).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: Build and run doesnt work and colours dont appear
« Reply #7 on: September 05, 2011, 08:40:53 pm »
On windows, you might need to scroll the BUild log, to see the output.
Their seem to be sometimes refreshing issues with wxWidgets on windows.
I dont get it? You mean i need to select the output that works on windows 7?

If you don't see any output in the "Build log", you might need to click into it and scroll it with the mousewheel, or scroll it with the scrollbar to make the content visible.
I only saw this on windows (xp and win7), not on any of the linuxes I tested.
Not sure if this also happens for the "Build messages" (and other listlogs), or only for textlogs like the "Build log".
« Last Edit: September 07, 2011, 09:20:04 pm by jens »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Build and run doesnt work and colours dont appear
« Reply #8 on: September 05, 2011, 08:41:29 pm »
No its not grayed out, i can click on the option but it doesnt pop up something. So i click on Build and Run, but nothing happens.
Are any messages displayed in the build log?
Did you check your hard-drive to see if the executable was created at all?

Edit:
If your build log looks something like this,
Code
"ProjectName - TargetName": The compiler's setup is invalid so Code::Blocks cannot find/run the compiler. Probably the
toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done (all items are up-to-date).
it means Code::Blocks cannot find your compiler (as it says).  If this is the case, first find the location of the compiler (I am assuming mingw based on the package you said you installed) on your hard-drive (because you installed the bundled version, it should be located in C:\Program Files\CodeBlocks\MinGW).  Copy the location.  Back inside Code::Blocks, open Settings->Compiler and debugger...->Toolchain executables (tab) and paste the path of your compiler into the Compiler's installation directory box.
« Last Edit: September 06, 2011, 12:29:42 am by Alpha »

Offline Just_A_Guy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Build and run doesnt work and colours dont appear
« Reply #9 on: September 07, 2011, 04:25:32 pm »
No its not grayed out, i can click on the option but it doesnt pop up something. So i click on Build and Run, but nothing happens.
Are any messages displayed in the build log?
Did you check your hard-drive to see if the executable was created at all?

Edit:
If your build log looks something like this,
Code
"ProjectName - TargetName": The compiler's setup is invalid so Code::Blocks cannot find/run the compiler. Probably the
toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done (all items are up-to-date).
it means Code::Blocks cannot find your compiler (as it says).  If this is the case, first find the location of the compiler (I am assuming mingw based on the package you said you installed) on your hard-drive (because you installed the bundled version, it should be located in C:\Program Files\CodeBlocks\MinGW).  Copy the location.  Back inside Code::Blocks, open Settings->Compiler and debugger...->Toolchain executables (tab) and paste the path of your compiler into the Compiler's installation directory box.
The Build Log is blanc, even if i type something.
Everything works except the build and run option.
Ok to get it clear:
I downloaded the new version of Code::blocks (10.05) - codeblocks-10.05mingw-setup.exe (binary release).
I installed all plugins.
The option Build and Run is NOT grayed out.
My default compiler is GNU GCC Compiler (C:\MinGW)
The project that i saved is a cpp. file.
The Build log is blanc, even when i type something like this and click on the run and build option:
 #include <iostream>
using namespace std;

int main () {
    cout << 'Hello everyone' ;
}
It does do nothing.
And if i change the compiler to something like this:
Intel C/C++ Compiler (C:\Program Files (x86)\Intel\Compiler\C++\9.0) it also does nothing.
« Last Edit: September 07, 2011, 06:14:44 pm by Just_A_Guy »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: Build and run doesnt work and colours dont appear
« Reply #10 on: September 07, 2011, 09:19:37 pm »
Did you try what I asked you to do:
On windows, you might need to scroll the BUild log, to see the output.
Their seem to be sometimes refreshing issues with wxWidgets on windows.
I dont get it? You mean i need to select the output that works on windows 7?

If you don't see any output in the "Build log", you might need to click into it and scroll it with the mousewheel, or scroll it with the scrollbar to make the content visible.
I only saw this on windows (xp and win7), not on any of the linuxes I tested.
Not sure if this also happens for the "Build messages" (and other listlogs), or only for textlogs like the "Build log".

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Build and run doesnt work and colours dont appear
« Reply #11 on: September 08, 2011, 04:30:23 am »
My default compiler is GNU GCC Compiler (C:\MinGW)
Is C:\MinGW the actual physical location on your hard-drive (of the mingw installation), or is it the location Code::Blocks has registered as the Compiler's installation directory (or both)?
If it is only the Compiler's installation directory, change the Compiler's installation directory to <CodeBlocksInstallFolder>\MinGW (most likely C:\Program Files\CodeBlocks\MinGW); this is where codeblocks-10.05mingw-setup.exe would have installed MinGW (do not click Auto-detect, because this often only resets the path from my experience).

If you have not yet, make sure you try what jens asked, as Code::Blocks "should" always output at least something to the logs.

Offline Just_A_Guy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Build and run doesnt work and colours dont appear
« Reply #12 on: September 10, 2011, 11:27:29 am »
Did you try what I asked you to do:
On windows, you might need to scroll the BUild log, to see the output.
Their seem to be sometimes refreshing issues with wxWidgets on windows.
I dont get it? You mean i need to select the output that works on windows 7?

If you don't see any output in the "Build log", you might need to click into it and scroll it with the mousewheel, or scroll it with the scrollbar to make the content visible.
I only saw this on windows (xp and win7), not on any of the linuxes I tested.
Not sure if this also happens for the "Build messages" (and other listlogs), or only for textlogs like the "Build log".
Yes i did.
I reïnstalled today CB, and finally it shows something up in the Build Log. (i've made a project cpp).
Its says: "ProjectName - TargetName": The compiler's setup is invalid so Code::Blocks cannot find/run the compiler. Probably the
toolchain path within the compiler options is not setup correctly?! Skipping...
So i know it cant find the compiler.
But i cant find the MinGW file.
My default compiler is GNU GCC Compiler (C:\MinGW)
Is C:\MinGW the actual physical location on your hard-drive (of the mingw installation), or is it the location Code::Blocks has registered as the Compiler's installation directory (or both)?
If it is only the Compiler's installation directory, change the Compiler's installation directory to <CodeBlocksInstallFolder>\MinGW (most likely C:\Program Files\CodeBlocks\MinGW); this is where codeblocks-10.05mingw-setup.exe would have installed MinGW (do not click Auto-detect, because this often only resets the path from my experience).

If you have not yet, make sure you try what jens asked, as Code::Blocks "should" always output at least something to the logs.
This location doesnt exist when i put it in the adress bar.
C:\Program Files (x86)\CodeBlocks, is the only location where i can find this file: mingwm10.dll

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: Build and run doesnt work and colours dont appear
« Reply #13 on: September 10, 2011, 12:23:44 pm »
This location doesnt exist when i put it in the adress bar.
C:\Program Files (x86)\CodeBlocks, is the only location where i can find this file: mingwm10.dll
Come one, a little thinking might help - surely the "Program Files" might not be there, so search for a folder named "MinGW" on your HDD: If it doesn't exist this means you did *not* install the compiler of the MinGW-based C::B setup file. In that case, run the installation again and make sure you select the compiler.

Please note: C::B is just an IDE that drives many compilers, so providing a compiler with C::B is something we only do for MinGW (as C::B is compiled under Windows using MinGW). You can (however) always install another compiler of your choice (i.e. MinGW based, too) and adjust the compiler path accordingly.

Read the C::B manual on how to do so.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Just_A_Guy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Build and run doesnt work and colours dont appear
« Reply #14 on: September 10, 2011, 01:00:45 pm »
Problem solved guys.
Thanks for all your help  :D