dynamic-linking

Why creating DLLs instead of compiling everything to a one big executable?

I saw and done myself a lot of small products where a same piece of software is separated into one executable and several DLLs, and those DLLs are not just shared libraries done by somebody else, but libraries which are done exclusively for this software, by the same developer team. (I'm not talking here about big scale products which ju...

Boost Test dynamically or statically linked?

We use Boost statically linked with our app but now I wan't to use Boost Test with an external test runner and that requires the tests themselves to link dynamically with Boost.Test through the use of the required BOOST_TEST_DYN_LINK define. Is this going to be a problem or is the way Boost Test links completely unrelated to the way the...

How exactly does linking in C# work?

I want to use a GPL'd library in my C# application, but not necessarily release my own code under the GPL. If I understand correctly linking against a GPL'd library using dynamic linking and not distributing the library in question means I can license my own app in any way I want (the users of my software would then be required to instal...

Tricky linking error in Visual Studio 2008 ...

In Visual Studio 2008, I have a solution which contains two projects: one project is a .dll, the other is a command line application which calls the .dll. If I remove one of the files ("ast.c"), then add it straight back in, I get the following error. How do I fix this error? Error 22 error LNK2019: unresolved external symbol "__d...

Hot-pluggable C++ library possible?

I'm looking to "hot plug" a library of C++ code. I'm interested in having this technique work cross platform between Linux/Mac/Windows. Basically I want to have the main program #include "StateMachine.h" which defines all callable interfaces. Then at runtime and DURING EXECUTION load and unload StateMachineLibrary.a to have my applica...

exectuable dependancies on libraries

When sharing an executable do i really need to worry about libraries used to make that executable? seems like that should be taken into consideration when generating the exe not when you have to run it. Just curious. I am pretty sure I don't have to worry but wanted to ask this question to make sure. better to be safe than sorry. ...

Is it OK to use DYLD_LIBRARY_PATH on Mac OS X? And, what's the dynamic library search algorithm with it?

I read some articles discouraging of the use of DYLD_LIBRARY_PATH, as the the path of dynamic library should be fixed using -install_name, @rpath, and @loader_path. In terms of making a program that runs both on Linux and Mac OS X, DYLD_LIBRARY_PATH of Mac OS X does exactly what LD_LIBRARY_PATH of Linux. And, we can share (almost) the ...

Cannot execute program if using boost (C++) libraries in release-version on WinXP

I have almost the same problem as described here. But I'm linking with release version of boost. I build it by myself under WindowsXP with gcc-toolset bjam --build-dir=build-directory toolset=toolset-name link=shared variant=release threading=multi linking as g++ -enable-auto-import -omain.exe main.o -L"path_to_boost_libdir...

Symbol not found error after upgrading to iPhone SDK 4.0, running on 3.1.3

I just upgraded to iPhone SDK 4.0, and recompiled my static libraries and app, and when I run it on a device with iOS 3.1.3 (using deployment target 3.0), it says: dyld: lazy symbol binding failed: Symbol not found: ___sync_fetch_and_add_4 Referenced from: /var/mobile/Applications/7CA42202-DA9D-4A10-918D-593362E18000/renderer.app/rend...

Symbol not found: _OBJC_CLASS_$_Article

I am working on an extension to Vienna to add the ability for third parties to write Objective-C plugins, but I am getting some runtime linker issues only when running in 64-bit mode (everything appears to work fine in 32-bit mode). My plugin, SynkPlugin, is loaded by the following code in Vienna.app: NSArray * bundlePaths = [NSBundle p...

Dynamically Linking Python Extension (.pyd) to Another Extension

Python Extension modules are just dynamic libraries, so I assume it's possible to dynamically link a Python extension to another. The problem is on Windows Python Extensions are are given the .pyd extension instead of .dll, so I can't get distutils to link to them when I run the setup script. (I don't think this is a problem on UNIX beca...

Linking with -R and -rpath switches on Windows

I,m using gcc compiler(MinGW) on Windows XP.I created a .dll library libdir.dll than I tried to build a program that is using that library. I don't want to put that .dll file into System or System32 folder nor to set path to it in PATH variable, what i want is to give that information to the program itself. I know there is a -R and -rpat...

how can shared library get its own base address

I have the offset address's of all symbols (obtained with libelf executing on its own binary .so). Now, at runtime, I would need to calculate the absolutue address's of all those symbols and for that I would need to get the base address (where the shared library is loaded) and do a calculation: symbol_address = base_address + symbol_off...

What do linkers do?

I've always wondered. I know that compilers convert the code you write into binaries but what do linkers do? They've always been a mystery to me. I roughly understand what 'linking' is. It is when references to libraries and frameworks are added to the binary. I don't understand anything beyond that. For me it "just works". I also unde...

Lazy symbol binding failed when linking C++ dynamic library

I'm writing a dylib in C++, but when I try to link it into my application, it gives me an error on execution: dyld: lazy symbol binding failed: Symbol not found: __ZN8Vector2DC1Ev Referenced from: /Users/noahz/Desktop/Singularity/Singularity Test App/build/Debug/Singularity Test App Expected in: /Users/noahz/Desktop/Singularity/Sing...

dlopen/etc doesnt compile. Unresolved symbol

Hi. I am exploring the usage of dynamic stuff. So far My program (main.cpp) doesnt want to compile, becouse dlopen&Co are "unresolved". I DID include dlcfn.h. I need the answer as soon as possible, becouse I have to go home in 30mins(doing rapidly other stuff also). The correct error message might be "undefined", but this is not my com...

Dynamic linking unable to resolve main symbols

I'm trying to dynamically link a module into my program. If I normally compile and link this module then the symbols in it are normally accessible to the C++ via declaring the function prototypes as extern "C". The module itself is a group of fortran functions, that call C++ functions that I have written. When attempting to dynamically ...

How can I verify linking between compiled Java code?

Generally speaking one set of code (the client code) links against another (the API code). Java linking is typically verified between .java & .class at compilation time or between .class & .class at runtime. However in the latter case verification is as and when bad references are encountered (i.e. it is lazy). Is there a way to force v...

Have an extra /directory/ in the results of a dynamic link on php page

Here I am again. I hate to be a bother but here's another zinger. I have a custom made shopping cart and have some dynamic links in the page that when served up in a browser will replace $name with the product name and $p with the procuct id number. I'm aiming for a link on the page like this: http://www.something.com/buy/ProductName/38...

Dynamic linking and Python SWIG (C++) works in C++ fails in python

I have a library for which I have created a python wrapper using SWIG. The library itself accepts user provided functions which are in an .so file that is dynamically linked. At the moment I'm dealing with one that I have created myself and have managed to get the dynamic linking working... in C++. When I attempt to run it in python I ge...