On Sun, 17 Feb 2008 12:05:53 -0600 (CST), Gilles Ganault
<nospam@[EMAIL PROTECTED]
> wrote in comp.lang.c.moderated:
> Hello
>
> I don't have much experience with C, and have to solve the
> following issue:
> - I need to build a small C program on Linux CentOS where I have the
> build environment, and copy the binary to AstLinux which doesn't
> - the libraries are a bit different
> - to save space, I'd like to use dynamic libraries instead of
> compiling statically.
What you have here is a Linux specific problem. The C language
doesn't define different systems or different libraries, and not
dynamic libraries at all.
> For instance, here's the LibC library:
> ============
> [CentOS]# ll /lib/libc*
> -rwxr-xr-x 1 root root 1586492 Dec 1 00:39 /lib/libc-2.5.so
> lrwxrwxrwx 1 root root 11 Jan 22 02:49 /lib/libc.so.6 ->
> libc-2.5.so
> ============
> [AstLinux] # ll /lib/libc*
> lrwxrwxrwx 1 root root 19 Jan 26 17:33 /lib/libc.so.0
> -> libuClibc-0.9.28.so
> ============
>
> And here's my program:
> ============
> [CentOS]# cat check_cid.c
> #include <stdio.h>
> #include <stdlib.h>
> #include <syslog.h>
> #include <string.h>
> //#include <cstdio>
> #include <sqlite3.h>
At least two of the headers you including, <syslog.h> and <sqlite.h>,
are not standard C headers but are system-specific extensions.
> int main(int argc, char *argv[])
> {
> //snip
> return(EXIT_SUCCESS);
> }
> ============
>
> Is it possible to tell Gcc which filename to use as the DLL, so that
> it doesn't complain when I copy the binary to AstLinux, and it will
> gracefully load eg. libc.so.0 instead of libc.so.6?
You really need to ask this in a group like
news:comp.os.linux.development.apps. All your questions are system
specific, and none of them are actually C language issues.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.para****ft.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
--
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
-- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line. Sorry.


|