Re: How to use my glib program on other computer?



On Tue, 21 Feb 2006 22:17:05 +0800, Peter Cai said:
> I've written a C program based on glib on my computer.  But when I copyied
> it to another computer, it did not work.

More details, please?  Did the program fail to start and complained about
an undefined symbol? Did the program start but then crash? Other?  Actual
error messages are *much* more helpful than "it did not work".

And it's always possible that glib is working correctly, but your program is
buggy in a way that fails on one system, but just happens to work on another
(for instance, if you're running off the end of an malloc'ed array by only
a few bytes, and one system allocates exactly the space allocated, and
another allocates up to the next multiple of 16 bytes - a program may run on
the second, and fail on the more stringent system).  Or you're simply running
off the end of an array, and on one system the heap happens to have something
on it that causes a crash, and on the other the error goes undetected.

I've had more than a few program mysteriously start failing on the *same*
system due to an upgrade of glibc/libc or whatever the low-level C library is,
because the upgrade changed the innards of the code, and thus the exact heap
layout.  These are usually a royal pain to debug... ;)

> Do I have to install a glib on that computer?

Maybe, maybe not.  Depends if glib is already installed, what release is on
each system, and what the actual problem is.

> Or can I change some gcc options to compile an application which already has
> the library in itself?

Possible, but ugly, and may not fix the problem, if the problem isn't one that's
solvable by static linking.

Attachment: pgpANZPtGMcIJ.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]