Code::Blocks Forums

User forums => Help => Topic started by: laserbeak43 on June 04, 2007, 07:18:54 pm

Title: GNU GCC Compiler not working
Post by: laserbeak43 on June 04, 2007, 07:18:54 pm
i get the error when i use the default compiler(GNU GCC Compiler):
"Chapt3challenge1 - Release" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Skipping...
Nothing to be done.

i don't think this is a bug, but just my lack of knowledge of compilers which is why i'm posting it here.

i have the visual studio 2005 compiler but i get so many warnings.

Code
#include <iostream>
#include <stdlib.h>
using namespace std;

int main()
{
    int x;
    int y;
cout << "Hello world!" << endl;
cout << "Please give me a number for x." << endl;
cin >> x;
cout << endl << "Now please givee me a number for y, which will be used to divide into x." << endl;
cin >> y;
if (y <= 0)
{
        cout << " Please enter a number greater than 0." << endl;
        cin >> y;
}
    x = x/y;
    cout << endl << "Thank you, x/y = " << x << "." << endl;

system("pause");
return 0;
}
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 04, 2007, 07:38:58 pm
Code
[13:14:44.392]: Scanned 0 files for #includes, cache used 0, cache updated 0
[13:14:44.392]: Scanned 0 files for #includes, cache used 0, cache updated 0
[13:14:44.402]: Scanned 0 files for #includes, cache used 0, cache updated 0
[13:14:44.412]: Scanned 0 files for #includes, cache used 0, cache updated 0
[13:14:44.522]: Can't find compiler executable in your search path (GNU GCC Compiler)...
[13:16:47.559]: Can't find compiler executable in your search path (GNU GCC Compiler)...
[13:16:53.638]: WARNING: "Chapt3challenge1 - Release" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Skipping...
[13:16:53.858]: WARNING: "Chapt3challenge1 - Release" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Skipping...
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 04, 2007, 08:36:34 pm
oh i dont think i hooked up the path variable

just did it and it still doesnt work. hmmm

am i supposed to be setting the path variable somewhere other than my computer?

ahh i see something in codeblocks

i have no C:/mingw/ folder what do i do?
Title: Re: GNU GCC Compiler not working
Post by: Biplab on June 04, 2007, 08:46:15 pm
You are supposed to install gcc (MinGW build on windows). Visit www.mingw.org for more details.
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 04, 2007, 11:46:34 pm
i've downloaded the runtime but i dont see any installers in there...

what do i get? there's no specific information about codeblocks that ive found
Title: Re: GNU GCC Compiler not working
Post by: TDragon on June 05, 2007, 12:01:18 am
The "MinGW-5.0.2" download under the "Proposed" heading on the (MinGW) downloads page is an installer that will help you install the necessary packages. For best results, however, I recommend doing it by hand -- download binutils-2.17.50-20060824 (http://downloads.sourceforge.net/mingw/binutils-2.17.50-20060824-1.tar.gz?modtime=1156937419&big_mirror=1), mingw-runtime-3.11 (http://downloads.sourceforge.net/mingw/mingw-runtime-3.11.tar.gz?modtime=1163845730&big_mirror=1), w32api-3.7 (http://downloads.sourceforge.net/mingw/w32api-3.7.tar.gz?modtime=1145039963&big_mirror=1), mingw32-make-3.81-1 (http://downloads.sourceforge.net/mingw/mingw32-make-3.81-1.tar.gz?modtime=1150815180&big_mirror=1), and gdb-6.3-2 (http://downloads.sourceforge.net/mingw/gdb-6.3-2.exe?modtime=1133217999&big_mirror=1). Extract the contents of all the .tar.gz archives an empty directory (usually "C:\MinGW"), and run gdb-6.3-2.exe and install GDB there as well. Then, open Code::Blocks, open the compiler settings, make sure "GNU GCC Compiler" is selected, go to the "Toolchain executables" tab, and hit Auto-detect if you installed everything in C:\MinGW. If you installed it somewhere else, hit the "..." button and select the directory you used. Remove all the directories in the "Search directories" sub-tabs and restart C::B for good measure, and you're set.
Title: Re: GNU GCC Compiler not working
Post by: oz on June 05, 2007, 06:18:45 am
i've downloaded the runtime but i dont see any installers in there...

what do i get? there's no specific information about codeblocks that ive found

Download and extract to C:\MinGW, that's all, I just simply packed all necessary together
http://savefile.com/files/753051 (http://savefile.com/files/753051)
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 05, 2007, 08:38:33 am
The "MinGW-5.0.2" download under the "Proposed" heading on the (MinGW) downloads page is an installer that will help you install the necessary packages. For best results, however, I recommend doing it by hand -- download binutils-2.17.50-20060824 (http://downloads.sourceforge.net/mingw/binutils-2.17.50-20060824-1.tar.gz?modtime=1156937419&big_mirror=1), mingw-runtime-3.11 (http://downloads.sourceforge.net/mingw/mingw-runtime-3.11.tar.gz?modtime=1163845730&big_mirror=1), w32api-3.7 (http://downloads.sourceforge.net/mingw/w32api-3.7.tar.gz?modtime=1145039963&big_mirror=1), mingw32-make-3.81-1 (http://downloads.sourceforge.net/mingw/mingw32-make-3.81-1.tar.gz?modtime=1150815180&big_mirror=1), and gdb-6.3-2 (http://downloads.sourceforge.net/mingw/gdb-6.3-2.exe?modtime=1133217999&big_mirror=1). Extract the contents of all the .tar.gz archives an empty directory (usually "C:\MinGW"), and run gdb-6.3-2.exe and install GDB there as well. Then, open Code::Blocks, open the compiler settings, make sure "GNU GCC Compiler" is selected, go to the "Toolchain executables" tab, and hit Auto-detect if you installed everything in C:\MinGW. If you installed it somewhere else, hit the "..." button and select the directory you used. Remove all the directories in the "Search directories" sub-tabs and restart C::B for good measure, and you're set.

hmm
that one didnt work. when i deleted the paths in Search directories' sub tabs and closed codeblocks, they just reappeard. and when i compiled i got the same error. so i cleared them then compiled without closing and it still didnt work.
everything is in C:\MinGW but autodetect didnt detect it. but the same path is entered there so i just left it alone. maybe i should enter it manualy.

ahh there are some files missing in the bin directory:
mingw32-gcc.exe
mingw32-g++.exe
i've downloaded all 5 files you specified. i wonder why it didnt work.

i'll try oz's package.

that did it!!
thanks a lot guys!! you guys you guys know your stuff well!!!

Title: Re: GNU GCC Compiler not working
Post by: TDragon on June 05, 2007, 03:24:40 pm
:o
I'm embarrassed -- I forgot to include the gcc-core and gcc-g++ packages in the list. So sorry...
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 05, 2007, 05:16:10 pm
don't be sorry!
i'll look back to this thread if i ever need to create a MinGW directory again!!! you've taken the time to help lots!

thanks again!!
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 06, 2007, 08:34:10 pm
thanks but my P4 computer is down. i'll remember that link though :)
Title: Re: GNU GCC Compiler not working
Post by: laserbeak43 on June 07, 2007, 06:43:18 pm
i see. i'll give it a try sometime then :)