adding c++ capability to a crosscompiler

Peter Barada
Wed Nov 6 14:34:00 GMT 2002

>any one have an idea of what went wrong???
>is it possible something is wrong with the native gcc install ???
>Many thanks for Bill's procedure that worked for the c xcompiler
>thank you 
>In file included from 
>   div_t' not declared
>   ldiv_t' not declared
>   div' not declared

This has been seen before, its sporadic, and no one has figured out
why its hapengin and a fix to prevent it from happening.  Here's
what's been gleaned from previous postings/emails:

From: Pete Gonzalez:

>>I've seen the 'ldiv_t undeclared' problem more than once before:
>>What I have determined is that if a build failed for some reason,
>>executing a 'make clean ; make ; make install' for the particular
>>component doesn't always work since the 'make clean' doesn't remove
>>the *installed* components, or *all* of the config files, so when the
>>build occurs, it fails again in the same strange way.
>>What I have found that works is to:
>>1) remove *all* the installed components including binutils, gcc and newlib
>>2) remove *all* of the object directory structures where the tools were
>>    built
>>3) rexecute the script which configures and builds the tools
>I have encountered exactly the same problem you described above.
>It seems that the GCC "fixincludes" script is creating a
>stripped-down "stdlib.h" file in build-gcc/gcc/include, which
>takes precedence over the real stdlib.h.  The "fixed" version is
>missing certain definitions which libstdc++-v3/include/cstdlib
>is looking for.  If you delete build-gcc/gcc/include/stdlib.h,
>then the problem goes away, but maybe it causes other problems.

You could try removing buikd-gcc/gcc/include/stdlib.h and trying again,
or you can try the more drastic method of blowing away the
installed directories, reinstall binutils+gcc-bootstrap+newlib, blow
away the build directory for gcc(including the object files),
reconfigure gcc for c++ and build.

Hope this helps...

Peter Barada                         
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list