It seems you are using the standard library as a shared library (default behavior) when linking your program at home.
Therefore, instead of really “linking” the library, your linker simply solves some characters and performs another operation, delaying the actual loading of the library at runtime.
When you run your program on your university computer, the loader (the program that actually loads your program into memory and throws the main thread) looks for the libraries that your program needs and tries to load them (see LD_LIBRARY_PATH on Linux if you're interested).
The problem is that you are linking your program at home with a version of stdlib, which is not the same version as your university. Therefore, when the bootloader tries to find the library, it fails, and therefore your program cannot be started.
Solutions:
a) To avoid all these problems, use static linking instead of dynamic linking. I'm not sure if this is possible with stdlib, but I think it's worth checking it out (see http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html and look for "- a static flag)
b) You can try to compile your program on your university computer so that it uses the version there.
c) Try to find out which version of stdlib is installed there and install the same version on your compiler.
d) You can try to copy the home version of stdlib to the same folder as your application. This usually works because the bootloader tends to search for shared libraries in the current application folder before searching in the path specified in the environment variable LD_LIBRARY_PATH (linux)
Hope this helps.
PS: Here you have a good introduction to static vs shared / dynamic libraries http://www.network-theory.co.uk/docs/gccintro/gccintro_25.html
And here ( http://en.wikipedia.org/wiki/Library_%28computing%29 ) is not a very pleasant, but more complete description of the library.
thamurath
source share