G
Gilles Ganault
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.
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>
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?
Thank you.
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.
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>
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?
Thank you.