Author Topic: Compilation / Build Freezes  (Read 7641 times)

Offline guitarro17

  • Single posting newcomer
  • *
  • Posts: 4
Compilation / Build Freezes
« on: March 24, 2009, 01:29:20 am »
Hello! I have a problem...

Sometimes, when I try to build some project, the compilation freezes forever...
And it stops only if I finish the process "mingw32-g++" and "as.exe"...

It occours about 50~60% of the time, and another times the building is normally...

What can be?

Thx! And sorry for my english, I don't speak english very well :P

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Compilation / Build Freezes
« Reply #1 on: March 24, 2009, 03:23:42 am »
It be your hard drive is going bad.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Compilation / Build Freezes
« Reply #2 on: March 24, 2009, 06:35:54 am »
I didn't meet this problem.
I have built OpenCV library, code::blocks , wxWidget library. All these libraries will take several minutes to finish, but the compiler haven't froze. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline guitarro17

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compilation / Build Freezes
« Reply #3 on: March 24, 2009, 04:42:37 pm »
It be your hard drive is going bad.


I think you are right, because this happen with the most simple of the codes and with complex too... all codes :(

Offline bubo

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compilation / Build Freezes
« Reply #4 on: March 24, 2009, 04:55:20 pm »
I had this problem too.
If you have Vista:

1. download all recomended OS updates (especialy 1st service pack)
2. download mingw3.4.5 patch for vista (or use newer mingw 4.2.1)
3. DON'T use parallel build (Compiler settings -> "Number of processes for parallel build":  set it to 1!)
4. if you use thirdparty libraries -> rebuild them all with new mingw

Optionaly:
Rarely it freezes when my notebook is in "battery saving" mode (follow 3rd point about parallel build)

I hope it will help
Regards

Offline guitarro17

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compilation / Build Freezes
« Reply #5 on: March 24, 2009, 10:14:56 pm »
I had this problem too.
If you have Vista:

1. download all recomended OS updates (especialy 1st service pack)
2. download mingw3.4.5 patch for vista (or use newer mingw 4.2.1)
3. DON'T use parallel build (Compiler settings -> "Number of processes for parallel build":  set it to 1!)
4. if you use thirdparty libraries -> rebuild them all with new mingw

Optionaly:
Rarely it freezes when my notebook is in "battery saving" mode (follow 3rd point about parallel build)

I hope it will help
Regards

I don't use Vista, but I will try this!
Where can I find this "Numer of process for parallel build" ?? I can't find this on "Settings -> Compiler and debugger"...

Is it in another place?

Offline guitarro17

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compilation / Build Freezes
« Reply #6 on: March 24, 2009, 10:20:12 pm »
I found... this is seted to 1 :(

Offline bubo

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compilation / Build Freezes
« Reply #7 on: March 25, 2009, 11:50:00 am »
It freezes when compiler can't create binary (".o") file wich is opened in another process.

Do in Windows:
check disk for errors + defragmentation (standard OS system tools)

Also check this:
Every file, dir, library, search path ... shouldn't have spaces!! Mingw can not handle this well.
Also mingw installation dir shouldn't have space (e.g "C:\Program Files\mingw" is wrong install dir).
Before build your project, look in windows's Task Manager if there isn't any hanging mingw process (cc1.exe cc1plus.exe collect2.exe). If yes end them, rebuild project!

Offline bubo

  • Single posting newcomer
  • *
  • Posts: 4
Re: Compilation / Build Freezes
« Reply #8 on: March 25, 2009, 12:01:58 pm »
OH and I forget one important thing:

When mingw is installed on drive C:\ and project or library is located on another drive (e.g. D:\) mingw goes MAD!