Pitt wrote:
> Thanks for your kindly reply. Let me explain a little bit of the
> code I am writting now. I am trying to port the code on windows to
> wince. But some of the headers in the original code are not being
> supported by wince. So I would like to find a proper cross compiler
> toolchain to get C libary for wince.
> Is this the best way to solve the problem or there is any other
> better idea?
I think you are going about this problem the hard way! You are also not
being very clear. And you are probably asking the wrong question on the
wrong forum.
First of all some counter-questions, to be precisely clear:
1) What was the orignal Win32 code built with? (toolchain and version)
2) What are you using to build the WinCE code? (toolchain and version)
3) Which headers exactly do you believe are missing?
Next let's be clear (forgive me if you know this, but I sense some
misunderstanding); a header file may contain several types of
information, typically macros, typedefs, structures, enums, function
prototypes, and global data declarations. If a header only contains the
first four of these, it can stand alone. Function prototypes and data
declarations however require a corresponding definition, provided by
external object modules usually either built from source or provided by
a library. So if a header declares functions or data, the header alone
is not sufficient.
Now some headers, such as stdint.h do stand alone and have no
corresponding object code. stdint.h is defined by the ISO C99 standard
and may not be included if your compiler only supportd C89 or C++. That
said stdint.h is trivial and easily implemented, you probably don't even
need to implement all of it to get your code to build,some of the types
defined are seldom used.
Another thing to consider is that Newlib is purely an ISO C standard
library, if you WinCE toolchain does not contain the headers you need,
they are probably either not ISO headers (in which case Newlib would be
of no help), or they are C99 headers not implemented in your tool. The
differences between C89 and C99 (especially in respect to the library)
are mostly trivial and can easily be reimplemented as needed, or the
code modified to avoid the dependency. So a simpler (and safer) approach
to porting this code would be to identify what code depends on such
headers and reimplement it. If you are not sure how, get help (but this
forum may not be the appropriate place, try
http://forums.devshed.com/c-programming-42 for example).
Another approach would be to update your WinCE toolchain to a version
that is more modern (if that is indeed the problem - whic is why I asked
the questions above).
Clifford