Problem when using C object file (.o) on different computers
I am trying to create an object file that can be used on any computer. So what I did was create a bunch of functions and put them in a .c file. Used gcc -c myfile.c which creates myfile.o. (I am running Windows XP and got gcc from DevC ++). Then I create another program that uses my object file.
Everything seems fine except when I try to copy the .o file and use it on another PC. When I copy my file that uses the object file, compiles it and runs it, it just gives a window that tells me the error and if I want to submit a bug report.
When I try to recompile the .c file of my object file on another PC and restart the program, it works.
So I don't understand why I can't just compile the .o file once on one computer, copy it to another computer, and create a program that uses the same object file without recompiling the object file.
Thank!
source to share