Sponsored Content
Top Forums Programming Compiling and linking Shared Libraries. Post 302449429 by JohnGraham on Monday 30th of August 2010 02:19:34 PM
Old 08-30-2010
Try:

Code:
gcc My_program.c libCommon.so.1.0.0 -ldl

(the -ldl links in libdl.so, which is what you want for dlopen() etc.)
 

10 More Discussions You Might Find Interesting

1. Programming

compiling and linking 2 C files ...??

Hi mates, I am trying to copile and link to C programs with command: cc file1,file2 but i raises the error "file not found" ... am i doing the right way? any suggestion will be appreciated. thanks abdul (4 Replies)
Discussion started by: abdul
4 Replies

2. Programming

Runtime Linking shared Objects

I'm runtime linking (dlopen and dlsym) to a shared object (library) I've created and after a number of function calls into the library the program core dumps (Illegal operation). This only occurs during runtime linking. If I use the same library and dynamically link during compile time everything... (3 Replies)
Discussion started by: dneely
3 Replies

3. Programming

Shared libraries

Hello everybody, I am having major problems at the moment with shared libraries and I have to little knowledge of them to solve them. So please, please help me :) Ok this is the problem: I have a library A, which uses B and C, and C uses again D. If I try to run A as plugin in apache,... (0 Replies)
Discussion started by: Micky
0 Replies

4. Programming

shared libraries

I am compiling code which produces .a and .la libraries. How can I produce .so libraries? I know that gcc -shared does but how? (2 Replies)
Discussion started by: thalex
2 Replies

5. Programming

Linking problem while linking to shared library

Hi I'm getting ld: fatal: option -h and building a dynamic executable are incompatible ld: fatal: Flags processing errors When I run ld -shared -L/usr/dt/lib -lDtSvc -o builtin.so Workspace.o after running gcc -fPIC -I/usr/X11R6/include -I/usr/dt/include -c Workspace.c I'm... (6 Replies)
Discussion started by: laho
6 Replies

6. Programming

beginner at C: Need help compiling/linking with gcc

I'm trying to do something fairly simple but keep getting frustrating messages.. Here it is: I have 3 files: init.h <header> init.c <#include <curses.h> and "init.h"> main.c <#include "init.h"> now, how can I compile my main.c using gcc? ( I have a hard time making the init.o) ... (1 Reply)
Discussion started by: My_Name
1 Replies

7. Programming

Linking with shared objects

hi all ! Do I need all the shared objects to be present while compiling my code which has reference to a only one shared object, which in turn refers to another shared object. for example I want to compile example.c which refers to sample.so sample.so has refrence to anothersample.so do... (2 Replies)
Discussion started by: disclaimer
2 Replies

8. Linux

Shared Libraries

How do i make a library shared say i have a library a.so which i have just compiled. I want to make it shared how do i make it Next Queation is what is the difference between a.so.0 a.so.1 a.so.2 & a.so :rolleyes: (1 Reply)
Discussion started by: wojtyla
1 Replies

9. OS X (Apple)

Linking to a shared library

I'm trying to get Valgrind to work with an openmpi application in OS X. However I want to hardcode the path to a shared library called libmpiwrap-amd64-darwin.so into my application so that it is available at runtime. In Linux this is relatively simple, I would just add the option... (0 Replies)
Discussion started by: Valgrinder
0 Replies

10. SuSE

Problem compiling the kernel and linking problems in OpenSuse 12.3

Hi everyone I installed OpenSuse 12.3 and many development tools but when i propose build the kernel from the source (the first step make menuconfig) i saw this: HOSTLD scripts/kconfig/mconf /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libdl.so.2,... (2 Replies)
Discussion started by: bacesado
2 Replies
tnfctl_internal_open(3TNF)				       TNF Library Functions					tnfctl_internal_open(3TNF)

NAME
tnfctl_internal_open - create handle for internal process probe control SYNOPSIS
cc [ flag ... ] file ... -ltnfctl [ library ... ] #include <tnf/tnfctl.h> tnfctl_errcode_t tnfctl_internal_open(tnfctl_handle_t **ret_val); DESCRIPTION
tnfctl_internal_open() returns in ret_val a pointer to an opaque handle that can be used to control probes in the same process as the call- er (internal process probe control). The process must have libtnfprobe.so.1 loaded. Probes in libraries that are brought in by dlopen(3C) will be visible after the library has been opened. Probes in libraries closed by a dlclose(3C) will not be visible after the library has been disassociated. See the NOTES section for more details. RETURN VALUES
tnfctl_internal_open() returns TNFCTL_ERR_NONE upon success. ERRORS
TNFCTL_ERR_ALLOCFAIL A memory allocation failure occurred. TNFCTL_ERR_BUSY Another client is already tracing this program (internally or externally). TNFCTL_ERR_NOLIBTNFPROBE libtnfprobe.so.1 is not linked in the target process. TNFCTL_ERR_INTERNAL An internal error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWtnfc | +-----------------------------+-----------------------------+ |MT Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
ld(1), prex(1), TNF_PROBE(3TNF), dlopen(3C), dlclose(3C), libtnfctl(3TNF), tracing(3TNF), attributes(5) Linker and Libraries Guide NOTES
libtnfctl interposes on dlopen(3C) and dlclose(3C) in order to be notified of libraries being dynamically opened and closed. This interpo- sition is necessary for internal process probe control to update its list of probes. In these interposition functions, a lock is acquired to synchronize on traversal of the library list maintained by the runtime linker. To avoid deadlocking on this lock, tnfctl_inter- nal_open() should not be called from within the init section of a library that can be opened by dlopen(3C). Since interposition does not work as expected when a library is opened dynamically, tnfctl_internal_open() should not be used if the client opened libtnfctl through dlopen(3C). In this case, the client program should be built with a static dependency on libtnfctl. Also, if the client program is explicitly linking in -ldl, it should link -ltnfctl before -ldl. Probes in filtered libraries (see ld(1)) will not be seen because the filtee (backing library) is loaded lazily on the first symbol refer- ence and not at process startup or dlopen(3C) time. A workaround is to call tnfctl_check_libs(3TNF) once the caller is sure that the filtee has been loaded. SunOS 5.11 1 Mar 2004 tnfctl_internal_open(3TNF)
All times are GMT -4. The time now is 10:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy