Sponsored Content
Top Forums Programming Specifying dynamic library path to linker at compile time Post 302882529 by MadeInGermany on Tuesday 7th of January 2014 03:51:28 PM
Old 01-07-2014
-rpath is for the C-program ("simple") itself, not passed to the "exec"ed program.
But you can define the LD_LIBRARY_PATH environment variable in the C-program:
Code:
putenv ("LD_LIBRARY_PATH=/aaa/bbb/bin/waitdb.ORACLE");
execvp ...

 

10 More Discussions You Might Find Interesting

1. Programming

how to auto load a dynamic library

hi, every body. i have in trouble that how to load a dynamic library by hand. for example, i know how to generate a dynamic library and how to link a dynamic library in makefile. generate a dynamic library: add -dy -G behind cc link a dynamic library in makefile: add -dy -Bdynamic behind cc... (0 Replies)
Discussion started by: subrain
0 Replies

2. Programming

How compile a library on solaris(like dll in windows)

Hi all, how do i compile a c program into a library on solaris Thanks in advance Zing (3 Replies)
Discussion started by: zing
3 Replies

3. Programming

loading a dynamic library in linux

is there a way to load a dynamic library in linux? I know tht in AIX u can do it using the loadAndInit() function. Please guide me (2 Replies)
Discussion started by: jacques83
2 Replies

4. Programming

overriding the dynamic library

Hi, I wonder how can we override the dynamic library loaded by ld on start up.(dynamic linked application). so that linker uses the new library to find symbols. Is it possible to do. Cheers. (4 Replies)
Discussion started by: Raom
4 Replies

5. HP-UX

dynamic linker error

Hi All Could anyone help in giving a little background to the following runtime error. /usr/lib/pa20_64/dld.sl: Mmap failed due to errno: 13. Seen when executing a 64-bit ELF executable. Thanks Ed (3 Replies)
Discussion started by: C3000
3 Replies

6. Programming

Dynamic library load with dlopen

Hi, I created two library libsum.so and libproduct.so. In the libproduct.so is defined function "product" that use function "sum" defined in libsum.so. So libproduct depends on libsum. In main function I called product function by a dlopen request. Unfortunaly, when I execute program I have an... (5 Replies)
Discussion started by: shade82
5 Replies

7. SCO

SCO openserver Dynamic linker corruption

Hi every body I have a problem like that "Dynamic linker error" message. I can't load many of programs in sco unix openserver 5.0.6. I guess this problem appear after my last effort to install "SCO Development System" package. How can I fix this problem? would you please help me ? (1 Reply)
Discussion started by: javad1_maroofi
1 Replies

8. Programming

C Library reference error using sqrt() - will not compile.

This so basic that it should work.... Any ideas would be appreciared. Using a number directly in the sqrt allows it to compile. primrose > cat a.c #include <stdio.h> #include <math.h> int main(void) { double abcd=9; printf("%f\n",sqrt(abcd)); } primrose > gcc a.c Undefined first... (2 Replies)
Discussion started by: plastichead
2 Replies

9. Programming

problem in dynamic library*.so

hello I apologize if my question bothers you I work on a code developed in C + + which worked well on mac os, this code will help create libraries *.so from *.cc and *.h I used this as flags:CXXFLAGS = -g -O2 -fPIC -Wall -ldl -D_GNU_SOURCE ,CXX := g++ and $(CXX)-shared -o $(LIBNAME) $(CLIBLIB)... (0 Replies)
Discussion started by: pheapc
0 Replies

10. Programming

Gcc linker search path order

I have a build where I wish to link against and load a specific version of a library and a different version of the same library is installed on the system. I'm using a -L option to point to the version that I wish to link against but gcc still seems to choose the installed version. Is there a way... (4 Replies)
Discussion started by: Richard Johnson
4 Replies
fixso(1)						      General Commands Manual							  fixso(1)

NAME
fixso - Fixes a shared object so that it can be quickstarted SYNOPSIS
fixso [+i | -i] [+w | -w] [+d | -d] [+n | -n] [-V] [-o outputobj] [-p path] inputobj OPTIONS
Turns informational message reporting on and off, respectively. By default (-i), informational messages are not reported. Turns warning message reporting on and off, respectively. By default (+w), warning messages are reported. Turns debugging message reporting on and off, respectively. By default (-d), debugging messages are not reported. Turns output generation on and off, respectively. By default (+n), fixso writes output to a.out or to the file specified by the -o option. If you specify -n, fixso just analyzes the inputobj and generates no output. Displays the version of the fixso command. Specifies the file to which fixso writes its output. By default, output is sent to a.out. Adds path to the beginning of the shared library search path. The default library search path, as explained in loader(5), is used. The fixso utility also honors any definition of the LD_LIBRARY_PATH environment variable. DESCRIPTION
The fixso utility allows executables that depend on a shared library registered in the so_locations database to continue to run quick- started even if the shared library changed after the time the executable was originally linked against it. The fixso utility accomplishes this by adjusting the object's checksum and timestamp, reconciling the object's conflict table (the list of symbols that are multiply defined among the entries in the object's library list), and resolving global symbols. You specify one executable or shared object in the inputobj parameter. The fixso utility opens the target object, scanning its library list for dependencies on symbols defined in other objects. When it discovers a dependency, it automatically opens the associated object and con- tinues processing it in the same manner, as long as it is located in the default library search path, the path indicated by the LD_LIBRARY_PATH environment variable, or specified by the -p option. Otherwise, it generates a message advising you to run fixso on that object first. The fixso utility examines each object's interface version, shared object name (soname), timestamp, and checksum. Although it can adjust timestamp and checksum discrepancies among the entries in the object's library list, fixso has the following limitations: The fixso utility does not change the size of the binary object; it will not expand the size of the conflict table if it encounters a new multiply-defined symbol while traversing the object's library list. An object's actual run-time memory location must match the quickstart location recorded in the so_locations file. The fixso utility cannot make an object quick-startable if the object has been moved from its quickstart loca- tion, or if another object has been moved into its quickstart location. The version of the run-time linker interface used by an object mapped in the inputobj's library list must be the same version used when inputobj was created by the linker. An object mapped in inputobj's library list must be located in the same library search path it was in when inputobj was created by the linker. The soname of an object mapped in inputobj's library list must be the same as when inputobj was created by the linker. By default, an object's soname is its filename (without a prepended pathname). ERRORS
The fixso utility generates the following types of messages: Error messages that indicate when the current use of the tool violates one of its limitations, as described previously. Error messages also help you determine the correct order in which to run fixso on a series of objects. You cannot turn off error messages. Warning messages that indicate conflicts, such as timestamp and checksum mismatches, that fixso attempts to fix automatically. The fixso utility generates warning messages by default. You can turn them off by specifying the -w option. Informational and debug messages that record the fixso utility's progress. These messages are turned off by default, but you can turn them on by using the +i and +d options, respectively. FILES
Shared library directory. Shared library directory. Shared library directory. Shared library directory. Shared library directory. Fix quickstarted shared objects utility. SEE ALSO
ld(1), loader(5) Programmer's Guide fixso(1)
All times are GMT -4. The time now is 05:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy