some problem about cross C language from Linux to PC win98

Brendan Simon bsimon@ctam.com.au
Tue Dec 21 16:03:00 GMT 1999


"Haifeng Lin ~!~" wrote:

> I am using Dev-C++ 3.0 to run C language from my PC.
> I have win98 and Dev-C++3.0 for my PC.
>
> Now, I have some old C programming(include some header files: some is
> standard system's and others were done by myself.) in Linux system and I
> could run them in linux system.
> I mean  how to run some C programming (it was in Linux system) in PC
> system??
>
> How can I exchange their header files from Linux to
> Dev-C++3.0 in PC. I think it is difference linux and PC's C language
> header files name, direct...
>
> My Win98 PC may find my Linux root direct and all of files.
> If I just change C language's include and bin header files direct to
> DevC++3.0??

I don't know anything about DevC++.  If you want to compile the same programs on
multiple platforms (linux, pc, etc) then you must write your programs in a
portable manner.  Use standard ANSI header files to system headers.  If you must
use specific header files for DevC++ modules then you should so something like
#ifdef DEV_C and #endif around the specific parts.  Substitute DEV_C with
whatever your compiler defines.

The other alternative is to ditch DevC++ and move to GCC.  GCC runs on just about
every platform you can think of.  This means you can use the same Makefiles and
command line switches for all platforms and your code will have much less
conditional compilation statements (ie. #ifdef DEV_C) which makes it easier to
read.  You can get Mingw32 and Cygwin32 for Win32 machines.  These are
ennvironments for the GNU tools such as GCC, etc.

Cygwin uses a DLL to provide a POSIX/UNIX API so that POSIX/UNIX programs can be
ported to Win32 without having to change the code (well very little if any).
It's a little slower than the Mingw32 tools which only use the standard Microsoft
DLLs, but you get a nice unix like distribution of tools.  It depends on your
needs.  Visit the Cygwin32 and Mingw32 home pages for more information.

Brendan Simon.

PS. I recommend ditching DevC++ and using industry standard tools on all
platforms.  That's the GNU tools for me.




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list