Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > Re: [newbie] No...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 1047 of 1126
Post > Topic >>

Re: [newbie] Not specifying the dynamic library?

by Jack Klein <jackklein@[EMAIL PROTECTED] > Mar 8, 2008 at 12:20 PM

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.
 




 3 Posts in Topic:
[newbie] Not specifying the dynamic library?
Gilles Ganault <nospam  2008-02-17 12:05:53 
Re: [newbie] Not specifying the dynamic library?
jgd@[EMAIL PROTECTED] (J  2008-03-08 12:19:44 
Re: [newbie] Not specifying the dynamic library?
Jack Klein <jackklein@  2008-03-08 12:20:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 0:56:45 CDT 2008.