Friday, September 18, 2009

Problem in compliation on GCCE & CW

I encountered a compilation problem when trying to build a huge library which require many other APIs. It happened on both CodeWarrior and GCCE! What could it be?
Carbide.C++ for CW seemed to compile all cpp files but could not complete the complilation at the end then hang over. (No compilation error had been reported) Whereas GCCE was even worse,
Internal compiler error in dwarf2out_finish dwarf2out.c 13110!!

was yield after several cpp files built. Although commenting out these reported error file, the error was still moved to the other files! It should not be the error from source code anyway.

Adding OPTION CW -w off in your mmp file sounded to solve the problem on CW! (At least in my case, there were too much warning that's why the compiler couldn't end the compilation beautifully!)
And now what about GCCE ? I did the same with OPTION GCCE -w to suppress the default "-Wall -Wno-ctor-dtor-privacy -Wno-unknown-pragmas" in
Checking the GCC document, I then decided to change the debug option from "dwarf" to "stabs" but this did not help either. (-gdwarf-2 and g3 are the default GCC setting, so I override this setting in the project file, my mmp.)
Hmm...let's try other setting. This time with with OPTION GCCE -g -g1 -ggdb ...and it worked!! Done!