I'm trying to create an object file which can be useable in any computer. So what I did was create bunch of functions and placed them in a .c file. Used gcc -c myfile.c which produces myfile.o. (I'm running Windows XP and got gcc from DevC++) I then create another program which uses my object file.
All seems fine except when I try copying the .o file and use it in another PC. When I copy my file which uses the object file, compile it and run it, it just gives the window that informs me of an error and if I wish to send it an error report.
When I try recompiling the .c file of my object file in the other PC and rerun the program, it seems to work.
So what I don't understand is why I can't just compile the .o file once in one machine, copy it to another machine and create a program that uses the same object file without having to recompile the object file.
Thanks!