First, I want to indicate for the record that this issue is related to school / homework.
Suppose that computers CP1 and CP2 use the same operating system and machine language. If program C is compiled on CP1, to transfer it to CP2, you need to transfer the source code and recompile to CP2 or simply transfer the object files.
My gut answer is that object files should be sufficient. C code is converted to assembly by the compiler and assembled by assembler into machine code. Since the architecture has the same machine code and operating system, I see no problem.
But the more I think about it, the more confused I start to get.
My questions:
a) Since it refers to object files and not to executable files, Im assumes that there was no connection. Will there be any problems when connecting to CP2?
b) Does it matter if the code used the C11 standard for CP1, but the only compiler on CP2 was C99? I assume that it doesn't matter if the code was compiled / compiled.
c) The question does not indicate shared / dynamic linked libraries. Thus, this will only work if the program does not depend on the .dll / .so / .dylib files, otherwise they will also be required on CP2.
I feel that there are so many mistakes, and given how vague the question is, I now feel that it would be safer to just recompile.
Halp!
kbirk
source share