User forums > Help
GNU GCC Compiler is compiling REALLY slow.
Alos:
codeblocks.exe takes up all the cpu time when compiling.
With the code main(); i got an error of: main.cpp line 1 message, error: expected constructor, destructor, or type conversion before ';' token.
Took about 14 minutes to finish compiling and give me the error.
thomas:
So it is either a bad compiler setup, or more likely something's wrong with your Code::Blocks install. Obviously, you don't need to think about SDL before you can compile int main(){return 0;}.
Unluckily, this kind of problem can be quite hard to solve. You could use an odd version of either the IDE or the compiler (maybe a custom build, too), or might miss some files, have dll conflicts, or whatever... some people have reported problems with non-ASCII characters in a pathname - the possibilities are manifold.
When first using Code::Blocks, I had version conflicts, too (although it was clearly my own fault). What I learned from this was to keep things as simple as possible. The simpler, the better.
Here is a foolproof install that does work reliably:
* Deinstall Code::Blocks and remove anything that you installed by hand (like 5 different compiler versions)
* Download the current release candidate of Code::Blocks without compiler from here:
http://prdownloads.sourceforge.net/codeblocks/codeblocks-1.0-rc1-1.exe?download
* Install Code::Blocks into C:\codeblocks -- do not use a fancy path with spaces or special characters
* Make a folder C:\mingw - again, no fancy names, keep things as simple as possible
* Finding the right files to download is a bit tricky if you have never installed MinGW manually. I made a list in the WiKi that contains links to all you need: http://wiki.codeblocks.org/index.php/MinGW_installation
Decide whether you want 3.4.2 or 3.4.4 (not both!), and download everything under "Base system with C++" (plus anything you want from "optional").
* Put all the downloaded files into the folder C:\mingw that you created earlier.
* Unpack them all (I assume you have some kind of file archiving utility like 7z, WinZip, WinRar, PowerArc, or else). The usually available "decompress here" item from the Explorer context menu does the right job.
* If you have cygwin on your PC, make sure cygwin's binary and library dirs are not in your PATH. If you really want to include them, make sure they come last. Otherwise, you can get the strangest and nastiest errors, not only with Code::Blocks, but also with other programs (for example, gaim is known to crash due to this, and some standard tools coming with cygwin are... well, let's not pronounce it).
* If you want to eventually use the commandline tools from a DOS window, add C:\mingw\bin to your path (not necessary if you only use Code::Blocks).
* Start Code::Blocks, it should prompt you for the compiler you installed. If it does not, go to compiler options, and use auto-detect like you already did once, or enter C:\mingw manually, whichever you like.
* Make a console project from a template, save it to C:\test (again, no fancy names) and compile it.
This must not take longer than maybe 1-2 seconds, and it must not fail.
* Now, after this worked, you can get more courageous and try something else, like SDL and fancy pathnames, adding third-party plugins, etc.
Alos:
Ok I downloaded all the 3.4.4 base files and the debugger, but is there anything else i should do? Any install to run besides the debugger? When I go into code::blocks its not finding any of the files and I dont know what to put there, but I looked at my previous post where i had.
C compiler: mingw32-gcc.exe
C++ compiler: mingw32-g++.exe
linker for dynamic libs: mingw32-g++.exe
linker of static libs: ar.exe
debugger: gdb.exe
resource compiler: windres.exe
make program: mingw32-make.exe
but the apps in the mingw folder are: add2line, c++, cpp, dos2unix, drmingw, mingw32-make, pexports, redir, reimp, res2coff, test, testcpp, unix2dos.
So trying to find the matching files wont work. Am I missing a few files?
thomas:
Right above all these is "installation path:". Enter C:\mingw there.
Alos:
Ok its in there. what next? Trying to compile with just that gets me: cant find executable in your search path for GNU GCC Compiler.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version