Transferring a C program from a Mac to an IBM clone
Greetings folks,
Maybe a dumb question but can you transfer a C program from an Intel based Mac to an IBM clone and expect it to work? I'm assuming there is communication to/from USB involved. Would it need to be compiled on the IBM clone or would it just work? Thanks, --glenn |
Quote:
Copy the C source code over however you want. You will then have to compile it...and it *MIGHT* work. If it uses specialized Mac libraries that aren't present/available for whatever else you're compiling on, then it's up to you to either find those and install them, or in some cases, write your own work-arounds. |
That's what I was thinking, than you very much.
--glenn |
Also the term "IBM clone" is interesting. Are we talking an IBM Mainframe, IBM Midrange, IBM SP2, IBM PC, or perhaps an IBM Selectric Typewriter?
I am betting the IBM PC, but IBM has released a LOT of products over the years! Although it would be an intriguing IBM Selectric clone that would run a C compiler.... Transferring source is just transferring text. If the target does not use EBCDIC you may not even need to translate. The differences in the standard libraries might make porting a pain, but I have not tested to see how MUCH of a pain. |
Yes, an IBM Compatible PC. AMD_64 I'm guessing.
Thanks, --glenn |
Can you expect it to work? Yes.
Without a LOT of fixing and translation to the compiler and library on the target machine? Probably not. I mean, it IS possible, but seriously unlikely and the bigger the project the less likely it is to compile without issues. This would be considered a "porting project". |
If you are moving from "Intel iron" to "Intel iron," and are careful with your type definitions and compiler options, you can usually "port" an application from one compiler to another with a minimum of fuss. It's easier if the compiler that you want to use is available on both.
|
I won't be the one doing the porting but I will pass that on to the guy doing the work.
Thank you, --glenn |
The gcc compiler [suite ...], for instance, does run on both platforms. There are various online tutorials which show you how to do it. But, Microsoft makes excellent compilers, too. In short, you have several good ways to approach this problem, and you should be successful.
|
OK
Thank you, --glenn |
Assuming you’re copying the C source code over and compiling it: the answer is “maybe; try it.”
If you’re copying the compiled binary over, then the answer is no. |
Yeah, as soon as the computer is available. Another guy is looking at it at the moment.
Thanks, --glenn |
All times are GMT -5. The time now is 04:46 AM. |