linker

Instantiation of function object with different inline function definitions depends on order of linkage

Hi all, Please help me understand the root cause of the following behaviour. In file a.cpp I have: namespace NS { struct Obj { void pong(){ cout << "X in "__FILE__ << endl; } double k; }; X::X() { Obj obj; obj.pong(); } void X::operator()() { cout << "X says hello" << endl; } } In file b.cpp I have: namesp...

Linking with .so files (webkit)

Hi, I'm trying to create a program that uses some of the code from WebKit/GTK+. Specifically, I want to load a string, use WebKit's parser to construct a DOM tree and then iterate over that tree. I'm trying to use a class called HTMLDocument. WebKit/GTK+ doesn't expose this as part of its API and I'm running into some trouble linking ...

Segfault on C++ Plugin Library with Duplicate Symbols

Hi, I have a cross platform C++ application that is broken into several shared libraries and loads additional functionality from plugin shared libraries. The plugin libraries are supposed to be self contained and function by themselves, without knowledge of or dependency on the calling application. One of the plugins contains copied...

What is the best way to eliminate MS Visual C++ Linker warning : "warning LNK4221" ?

I have a CPP source file that uses #if / #endif to compile out completely in certain builds. However, this generates the following warning. warning LNK4221: no public symbols found; archive member will be inaccessible I was thinking about creating a macro to generate a dummy variable or function that wouldn't actually be used so this...

If I modify and dynamically link against a modified LGLP Lib, do I have to make the changes available?

I have found a bug in an LGPL Lib that I currently link against dynamically. The application is closed source I link dynamically to the LGPL Lib The application will be available to the public If I modify the lib my understanding is that I will have to make the changed source files availible with the application, is this correct? ...

Can't add static lib

I am trying to build a DLL and it needs to reference a library namely libeay32.dll from the openssl package. I cant seem to add it as a reference under the Property Pages->Common Properties->Add New Reference because it gives error "Could not add a reference to file 'C:\OpenSSL\libeay32.dll' because it is neither a .NET assembly or regis...

Why doesn't ld honor the '-rpath-link' option?

I detect this using strace: 8480 execve("/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld", [ "/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld", ... "-L/home/bjack/lib", ... "-rpath-link", "/root/src/firmware/Bj-bg/ab-BJ-gameprom-modules/src/dis...

Visual Studio merging DLL into console application

OK I'm getting desperate here so please I really need some help if anyone could be so kind. It must be a really simple thing but I am absolutely confused still how to fix this problem. I have very simple program to simplify things as shown below... #include <openssl/evp.h> int main (int argc, char *argv[]) { EVP_CIPHER_CTX ctx; ...

Problem with linking QuarzCore

Hello, I am new with Objective C and iPhone development but that is what I am trying to do... Problem is with QuarzCore and basic animation stuff. These lines are from my applicationDelegate: #import "QuartzCore/QuartzCore.h" ... -(void)performTransition { if(!transitioning) { CATransition *transition = [CATransition anim...

Compiling Twice with Delphi 6 and getting the same checksum on the binary

For the purposes of binary / source code verification, i'd like to be able to make two compiles on the same computer 2 weeks apart and have the binaries be identical and thus pass some checksum test. So far I've found that most likely the timestamp will be written by the compiler into the binary. I can work around this by doing the com...

C++ DLL fails when run from different drive letter

I've written a C++ DLL that connects to a Sybase database using the native C library for Sybase. I can build and run the program on my C drive, and others can run it from their C drives, and everything works. But in some situations both my DLL and the Sybase DLL are located on the F drive instead of the C drive. In those cases my DLL app...

How to use the .def file for explicit linking?

I am facing the the problem to link to a third party dll. It is windows mobile application, where I am try to link to this third party dll. Here first I had the dll and lib file. I was not able to link to it explicitly, but implicit linking is working. In the explicit linking the getprocaddress was failing. The dumpbin showed only the ...

mixing relase and debug static libraries in xcode iphone project

Hi, In my iPhone project, I use for Debug target one proprietary static library X (compiled in release mode). For the rest of my static libraries I have source files, so I can build them for relase and debug targets. When I execute my project (for debug target), after first call to function from library X, my program receives EXC_BA...

Error in building project

Hi, While building a c++ project for windows mobile 6.0 , i am getting an error fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'THUMB' i don't no the reason why this error is coming.. i do Google a bit.. since i hv not much idea about instruction set, its tough for me to find.. it will be helpful if ...

In Visual Studio 2008, how/why are extra (non-specified) .LIB files be added to the linking stage?

I discovered yesterday that one of our projects is linking in a few libraries that aren't specified in the project. I've double-checked (by manually reading the .VCPROJ file) that the .LIBs in question aren't specified. They aren't mentioned anywhere in the file, let alone in its 'libraries' section. And yet, when I look at the 'Comma...

why project dependency affect linker settings

Hi, any idea why project dependency (Visual Studio) affects linker settings (C++)? I thought that it's enough to chceck linker settings (Additional depend...) or pragma in source code. It's not a big problem, I'm just curious. Thanks. ...

MSVC: inspecting static libraries (fixing unresolved external symbols)

I wanted to ask what tools and techniques you use to fix linker errors in MSVC. My problem is, that I link an executable against a self built static lib and I get a lot of unresolved external symbols (LNK2019). I've tried building my libs with different calling conventions but I didn't succeed. I want to inspect that lib file (it's a de...

Segmentation fault when instantiating object from particular library

I have an C++ application (heavily shortened down, shown below); #include <iostream> #include "MyClass.h" void foobar() { MyClass a; } int main(int argc, char** argv) { std::cout << "Hello world!\n"; return 0; } Where "MyClass" is defined in a statically linked library (.a). However, this application Segfaults the instant its ...

Is the Visual Studio 2010 C++ linker faster with large projects?

I know it's still in beta, but I'm still really interested if anyone has seen any improvement on link times of large C++ applications. I did some testing myself, but I didn't get very far: I only got our low-level stuff to compile and run. Mid-level stuff gave weird C++ lib errors that couldn't be fixed by a couple of hours googling and...

Linking in Xcode

How do I make Xcode link object files properly? The file containing "main" and all the dependencies compile properly (and I can easily link them in the command line to generate the executable). However, Xcode seems to refuse to do it, resulting in ld errors of "symbol not found". This is what my current setup looks like. All the depend...