Sponsored Content
Full Discussion: shared libs
Top Forums Programming shared libs Post 302416721 by cyler on Tuesday 27th of April 2010 02:13:25 PM
Old 04-27-2010
=== SHARED ===
I have successfully linked ld-2.7.so by compiling like this:

gcc -std=c99 -D_POSIX_C_SOURCE=200112L -O2 -m32 -s -Wl,-dynamic-linker,ld-2.7.so myprogram.c

But I have not managed to successfuly link libc-2.7.so. How can I do that ?

=== STATIC ===
I have included the header netdb.h, where getaddrinfo is included, but gcc issues this warning:

warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

gcc -m32 -static -s -O2 -std=c99 -D_POSIX_C_SOURCE=200112L myprogram.c

How can I statically compile whatever file is missing ?

Last edited by cyler; 04-28-2010 at 08:38 AM.. Reason: SHARED and STATIC methods not functional yet
 

10 More Discussions You Might Find Interesting

1. Programming

compiling with include & libs

I like to compile a cxx file with g++ compiler. I tried with option g++ -I<include path> -L<library path> source-file but ending with compilation error in /usr/local/bin/gcc-lib/.../crt1.o I think the libraries are not taken from proper path How to compile a cxx file with libraries... (1 Reply)
Discussion started by: ls1429
1 Replies

2. Programming

default location of libs in dlopen

Hi Where is the default location of libs to search, when we specify any lib in dlopen function. And if we want to specify a custom location, how will we do it? thanks. (1 Reply)
Discussion started by: sumsin
1 Replies

3. Shell Programming and Scripting

who to compile needed libs with Make

Hello all my project is contains 2 directories, 2 directories are building library and one for the executable that using the libes from the other 2 Now what im doing is compiling first the 2 libs directories and then the main directory. But I will like to automate the process and to be able ... (0 Replies)
Discussion started by: umen
0 Replies

4. Programming

Seeking Some libs for AIX 5.3

hello everybody! I m compiling some program with the g++ on AIX 5.3 and it needs some library that i didn't find them i am new with the AIX here is the compilation error : g++ -Daix -fpic -o printps -lxercesc1_1 -L/oracle/OraHome/lib32/ -L/epost2/blitz/lib -lhmltods -lhmltops -lgeneric... (0 Replies)
Discussion started by: eternalflame
0 Replies

5. AIX

Q: AIX dynamic linked libs

I think the default extension on AIX is .a so for dynamic lib "libabc.a", we can simply link against it by specifying "-labc" but here I have a dylib which been built by some one else called "libxyz.so" on AIX. once I say "-lxyz" the linker is only looking for libxzy.a but not .so after that.... (2 Replies)
Discussion started by: acerlinux
2 Replies

6. AIX

runtime libs accessed by application in AIX

Hi , I need some inputs on runtime or shared libs for an application(s) in AIX . i have a requirement saying i need to rehost all the production applications into new AIX OS . Here Source and target oS is AIX but with different versions so for this i need to identify what are the... (1 Reply)
Discussion started by: naren_chella
1 Replies

7. Shell Programming and Scripting

Writing a 'Mad Libs' program using Ruby?

How would I go about writing a 'Mad Libs' type program using Ruby? Any examples would be greatly appreciated. Thanks! (0 Replies)
Discussion started by: greeky
0 Replies

8. SuSE

How to get RPM Dependencies/libs

Hi All, I wanted to install an rpm package on two suse 10 systems. It installed successfully on one system but on the other it throws an error like error: Failed dependencies: rpmlib(PayloadIsLzma) <= 4.4.2-1 is needed by linuxProj-1-1.noarch Now this means that rpnm... (4 Replies)
Discussion started by: dirshah
4 Replies

9. AIX

Create shared libs on AIX (with certain libs which are statically linked)

I want to create a shared lib with certain libs statically linked to it. I can generate a fully shared lib as follows: gcc -maix64 -DHAVE_CONFIG_H -I. -I./src -DHAVE_OPENSSL -I/usr/include/openssl -I/usr/include -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/usr/java8_64/include -shared -o... (0 Replies)
Discussion started by: amandeepgautam
0 Replies

10. UNIX for Advanced & Expert Users

Required libs to compile libXft

Hello. I am looking for all the necessary packages required to be able to compile libXft. I tried to compile libXft-2.1.8.2$ and the error message was: checking for XRENDER... checking for XRENDER... checking for X... no checking X11/extensions/Xrender.h usability... no checking... (1 Reply)
Discussion started by: colt
1 Replies
CERNLIB(1)						      General Commands Manual							CERNLIB(1)

NAME
cernlib - print CERN library dependencies SYNOPSIS
cernlib [options] libraries DESCRIPTION
cernlib is a tool to list the compiler and linker options necessary to compile a CERNLIB program that has the given library dependencies. It is generally used within a command substitution, as in the following example: gfortran -o myprogram myprogram.F `cernlib -G Motif pawlib` This version of cernlib has been completely rewritten from the original script provided by CERN. It now does recursive library dependency checking and removes duplicate entries. Note that by default, the cernlib script assumes that the CERN libraries are to be linked against statically; if the environment variables $CERN or $CERN_ROOT are specified, it looks for the libraries only in the "lib" subdirectory of those locations, not any "shlib" subdirec- tory. Furthermore, the script brackets the CERN libraries with linker instructions to link statically. This is done to preserve the orig- inal upstream behavior, in which all CERNLIB libraries exist only in static form. For instance, "cernlib packlib" outputs: -Wl,-static -lpacklib -lkernlib -Wl,-dy -lm -lnsl -lcrypt -ldl -lg2c If you want to link against ALL libraries (including CERNLIB) either statically or dynamically, call the cernlib script with its -safe flag to omit these bracketing linker flags. That is: if you want to link against all libraries (not just CERNLIB) statically, use the -static compiler flag and call cernlib with its -safe flag: gfortran -o myprogram myprogram.F -static `cernlib -safe -G Motif pawlib` and if you want to link against all libraries (including the CERN libraries) dynamically, use the same command without the -static compiler flag (the linker assumes dynamic linking by default): gfortran -o myprogram myprogram.F `cernlib -safe -G Motif pawlib` OPTIONS
-a arch Specify a system architecture, e.g. Linux (default), AIX, HP-UX, etc. -dy Equivalent to -safe; for backwards compatibility. -G driver Specify a graphics driver. The available options on Linux are X11 and Motif (the latter option will also work when the Lesstif library is present). -P, -s Ignored; for backwards compatibility. -safe Do not make any assumptions about whether the CERN libraries should be linked against dynamically or statically. (The default behavior, if this flag is not used, is to link them statically.) -u Do not include architecture-specific libraries in the output. -v version Specify version of $CERN_LEVEL. This is meaningless unless you have installed an upstream version of CERNLIB (i.e. not packaged by Debian); see the file /usr/share/doc/cernlib-base/README.Debian. -?, --help Show a summary of options. -- Tell cernlib that this marks the end of cernlib-specific flags, and all following arguments are to be parsed as described in the LIBRARIES section below. If -- is not given, the first word parsed as a library name will be the first word not starting with a hyphen "-" that is not an argument to a preceding cernlib flag. LIBRARIES
The following library names are recognized by this version of the cernlib script. These names may be used exactly as shown here, or pre- fixed by "-l". Core CERN libraries mathlib, packlib, kernlib Graphics and PAW libraries graflib, pawlib Monte Carlo and GEANT libraries cojets, eurodec, geant321, herwig59, isajet758, pdflib804, photos202, phtools Additional Monte Carlo libraries (to obtain these, see /usr/share/doc/montecarlo-base/README.Debian) ariadne, ariadne-p5, fritiof, jetset, lepto, pythia5, pythia6 Aliases The numerals at the end may be left off most of the library names above. Other library names Various other names are recognized for backwards compatibility, internal use, and non-Linux architectures. For the complete list, please see the cernlib script. Other Any names not recognized by cernlib that start with "-l" or with any character other than a hyphen ("-") are output as -l${name#-l} (i.e., are assumed to be a library). Names starting with a hyphen for which the second character is not "l" are assumed to be com- piler flags, and are output at the beginning of the line before all other output. SEE ALSO
/usr/share/doc/cernlib-base/README.Debian describes some of the changes that have been made to the CERN libraries in order to comply with Debian policy and the Filesystem Hierarchy Standard. CERNLIB documentation for all related libraries and programs is available at the following URL: http://cern.ch/cernlib/ AUTHOR
This manual page and the version of the cernlib script that it describes were written by Kevin McCarty <kmccarty@debian.org> for the Debian GNU/Linux system (but may be used by others). They are licensed under the GNU General Public License, version 2 or later (at your choice). COPYRIGHT
Copyright (C) Kevin B. McCarty, 2002, 2003, 2004, 2005, 2006. Jan 6, 2005 CERNLIB(1)
All times are GMT -4. The time now is 04:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy