linker

How to use two different versions of a linked lib (i.e. openssl) – one static and one dynamic?

Given I have a shared lib (“dynamic_one”) which links a specific version of a static lib (say 0.9.8 of openssl). Further I have an app which links another version of this lib (say 1.0.0 of openssl) dynamically and also loads the “dynamic_one” lib. Actually I encounter strange memory corruptions due to the incompatible ABI of the two ope...

Linking against an old version of libc to provide greater application coverage

Linux binaries are usually dynamically linked to the core system library (libc). This keeps the memory footprint of the binary quite small but binaries which are dependent on the latest libraries will not run on older systems. Conversely, binaries linked to older libraries will run happily on the latest systems. Therefore, in order to e...

WPF/C# can't find valid assembly reference

I've downloaded an open source third-party assembly for use in my WPF/.NET 4/VS2010 project. I've added a reference to the project's DLL and verified that VS2010 can see it by walking through the exposed classes in the object browser. When I add a "using" directive to the appropriate class in my project, Intellisense offers the new ass...

Why multiple definitions? Why are other references not defined? This is really basic, what am I missing?

I have a small project that I need to compile. I have one header and one source that I have created and a nearly empty driver.c that includes my header. Observe: // iol.h #ifndef __IOL_HEADER #define __IOL_HEADER /* program: iol.h date: 5 October 2010 */ #define UNIX 1 #define WINDOWS 2 #define OS UNIX #if OS == UNIX #...

In Xcode how do I specify the correct library in my project settings to avoid a link error?

I get a Undefined symbols error attempting to build an XCode project, and I'm pretty sure it is because the linker can't find a library (it's the library needed to use curses.h btw). I'm writing a terminal program. The errors I'm getting are: Undefined symbols: "_initscr", referenced from: _main in RogueSmackCmdLine.o "_wref...

How can I add the following extra linker flags?

To support OS 3.x, please set Base SDK to iPhone Device 4.0 and iPhone OS Deployment Target to iPhone OS 3.x. Extra linker flags may be needed if NSConcreteGlobalBlock and UIBackgroundTaskInvalid runtime error occur under 3.x. The linker flags are: -weak_framework UIKit -weak_library /usr/lib/libSystem.B.dylib EDIT: im still getting th...

How to dllimport in C++

I have a DLL and I would like to use some of its functions. #include <iostream> using namespace std; extern "C" __declspec(dllimport) int Initialize(char* localPort, char* adminServerName, int rpcTimeout); int main() { int res = Initialize("7864", "6000@kabc", 10000); return 0; } I don't have the DLL's .lib file, so is th...

GCC -m32 flag: /usr/bin/ld: skipping incompatible

On 64 bit host I am trying to build shared libraries with -m32 option. Is it possible for these libraries to be linked with regular 64 bit libraries? I am doing something like this: g++ -m32 -shared source.cpp -l 64_bit_library.so -o 32_bit_library.so and getting error messages like this: /usr/bin/ld: skipping incompatible 64_bit_li...

fundamentals of linkers as they apply to Xcode

I am working with libraries for the first time. The libraries in question are large, and there are a lot of them. Even after reading all the relevant material I could find on SO, I keep running into linker errors. Sometimes I manage to resolve them, but in the end I don't really feel like I understand what is going on. Is there a goo...

Forwarding data in a DLL

I need to forward a set of symbols from one DLL to another (to support some versioning scheme, PEP 384 if you wonder). It works fine for functions; I write a module definition file, saying LIBRARY "python3" EXPORTS PyArg_Parse=python32.PyArg_Parse PyArg_ParseTuple=python32.PyArg_ParseTuple PyArg_ParseTupleAndKeywords=python32.PyAr...

Help with Linker error LNK2038 !

I am trying to port a small app of mine from Win XP and VS 2005 to Win 7 and VS 2010. The app compiles and runs smoothly in Debug mode, however in Release mode I get the following error : pcrecpp.lib(pcrecpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LoginDlg.obj The wor...