HOw to load dynamic lib from a statically linked program ?


 
Thread Tools Search this Thread
Top Forums Programming HOw to load dynamic lib from a statically linked program ?
# 1  
Old 03-16-2005
Bug HOw to load dynamic lib from a statically linked program ?

I need to load a dynamic library from a statically linked program. Is there a way without recompiling my program.

when i try to do that my program just crashes.

If not possible, how can I avoid crashing the program when i try to load the dynamic lib, again without recompiling.

If my question was vague, plz tell me !

advance thanx,
D.
# 2  
Old 03-21-2005
'statically linked' means that the image file (the exe file) has every module it could ever need compiled into the file. Therefore it doesn't ever need to open a dynamic library when it runs. So it doesn't know how to load a lib.

Sounds like you are trying to port compiled code. What are you trying to do, exactly? If you expalin your whole problem there are probably lots of folks who know an answer.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Load different lib paths for different machines during ssh.

Greetings to every one, I have to access different clusters for computing. But the problem is their lib paths are different. :eek: How can i export some particular library paths for a particular machine ? For example Like cluster_1 (ip : 10.169.85.47) export LD_libPATH="/opt/CUDA" Like... (2 Replies)
Discussion started by: admax
2 Replies

3. Homework & Coursework Questions

create a program that runs two processes linked oven

I need help program in C... :create a program that runs two processes linked oven (1 Reply)
Discussion started by: gizmo16
1 Replies

4. Programming

dlopen failing on library with statically linked dependencies

I am attempting to port a program from OS X to Linux. It's C++ & Qt Creator and I did the original Windows to OS X port, so I tried to make it as POSIX-compliant as possible; the OS X port works well, and the Linux port builds and starts (it's on Ubuntu 9.10) but has some issues running. The... (2 Replies)
Discussion started by: Hodapp87
2 Replies

5. 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

6. 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

7. Programming

Dynamic loader taking function from wrong lib

Hi, I have two dynamically loaded libraries (shared objects), both of which include functions of the same name - foo. When I call 'foo' from libA, it takes it from libB, although it is implemented in libA as well. Since we need the function to be called from libA, we tried linking it with the... (1 Reply)
Discussion started by: rimon
1 Replies

8. Programming

how to use a dynamical linked library in C++ program in Linux

I have a dynamically linked library, providing some functions needed in my project. I have successfully imported it into my VC ++ 6.0 project. Now, i am translating the project into pure C++ (such as avoiding using MFC classess) in Linux box. Does anyone know if it makes sense to try to use... (2 Replies)
Discussion started by: cy163
2 Replies

9. Programming

how to compile a program statically

how can i do static compilation in cc and -lldap i have system defined and user defined header file. Can any one suggest any site where from i can get some information about static and dynamic compilation. Thankx (1 Reply)
Discussion started by: bhakti
1 Replies

10. 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
Login or Register to Ask a Question