linker

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

Gcc search path for crt1.o and crti.o

Hey I have compiled a cross-compiler tool chain with gcc and glibc. But I'm having some problems with the compiler. When I'm trying to compile a simple file it complains about a missing crti.o and crt1.o. These files does exist in ${TOOLCHAINPATH}/lib, but I do not know how to instruct the compiler/linker to look their. So, how can I...

Salamander .NET Linker - How does it work?

I'd like a step through of how the Salamander does what it does? I will include a few points im particularly interested in - Link On Demand The linker starts with the entry methods (which you can configure), and recursively walks the call graph to link only the required bits of MSIL code. Unused code will not be linked into the...

Why is my static library so huge?

I have a C++ compiled static library of about 15 classes and their member functions and stuff, and compiled, it's almost 14 megabytes. It links to Google's dense hash table library and MPIR, which is like GMP for Windows, but I did that in a plain exe and it was a few kilobytes. Why is it so massive? What can I do to reduce its size? It ...

How can I upgrade the sqlite3 package in Python 2.6?

I was using Python 2.6.5 to build my application, which came with sqlite3 3.5.9. Apparently though, as I found out in another question of mine, foreign key support wasn't introduced in sqlite3 until version 3.6.19. However, Python 2.7 comes with sqlite3 3.6.21, so this work -- I decided I wanted to use foreign keys in my application, so ...

ATL project created using wizard does not compile due to unresolved symbols

I have been working on getting a basic ATL project to compile in Visual Studio 2008 and I keep running into errors. Ultimately I have gotten stuck with the following build errors: 1>Linking... 1> Creating library Debug\SomeProject.lib and object Debug\SomeProject.exp 1>dllmain.obj : error LNK2001: unresolved external symbol _LIBID_Som...

Dynamic linking a library - successful when executable is built, same setup fails when another .so is made

I am writing a numerical code, in which I would like to use a third-party-written shared library. I am working on an x86_64 k8 architecture, under CentOS. The desired target that I would like to build would be either a Python or a Matlab extension module, which are, from what I understand, gcc-built dynamically-linked shared libraries, w...

How and why were linkers first developed as tools separate from compilers?

Basically, I'm just curious about the history. When was the first linker written? What was the rationale at the time? E.g. was multi-language development an issue? What platform did it target? What languages and compilers were supported? What interesting stages did they evolve through? ...

How to catch UnsatisifiedLinkError when using NDK-built library in an Android app?

I have an Android project that contains a class that uses JNI to pull a value from a C function. The C function was built into a library using NDK. The value returned from the C function is in turn used to initialize a variable inside a class when its first loaded. This works fine. However, I also want it to work when the library is miss...

[C/C++] Linking Problems

I've tried this on Linux and Windows... I've used C and C++... I've tried with wxWidgets, gtkmm, glfw and GTK+. I've tried with various IDE's and so on. (I managed to get GLFW to work fine at one point) My problem is I am somehow not linking libraries properly. However I cannot find out which library isn't linked because the errors are ...

Creating binary with CMake removes runtime path

Hi, I am using CMake to build a program on linux. The program compiles successfully and runs from the project build directory. The program is linked with a custom library in the directory ${HOME}/build/lib I have an install stage with: install(TARGETS ProgName RUNTIME DESTINATION bin) When I run make install the program gets put in ...

How to pass -libm to MPICC? libimf.so: warning: feupdateenv is not implemented and will always fail

I am a newbie who tries to compile a program via mpicc replacing icc with gcc. I have already discovered, that I need to use the following command to compile $ OMPI_CC=gcc make However, I get the following error message (which is well-known) /opt/intel/fce/9.1.036/lib/libimf.so: warning: warning: feupdateenv is not implemented and wi...

xcode project-/target-settings-syntax for linker flag force_load on iPhone

Hi all. I am confronted with the double bind, that on the one hand for one of the 3rd party static libraries, my iPhone application uses, the linker flag -all_load has to be set in the application project- or target settings, otherwise the app crashes at runtime not finding some symbols, called internally from the lib, on the other hand...

Problem with linking - iPhone app

I'm having an issue while trying to link an iPhone app to use one of the static libraries that I'm working with. The app works fine with iPhone OS 3.0, but when I try to upgrade to iOS4.0, I'm having a few issues. The library that I'm trying to use is an universal fat which contains versions for arm and i386. Now I'm getting the "symbo...

WSAStartup link error

I am using EVC++ and I want to compile the program which uses the sockets. I've included #include <winsock2.h> And I have included in project properties a path to Ws2.lib But still get the error at link step: error LNK2019: unresolved external symbol WSAStartup referenced in function ... How to resolve this problem? ...

How can I compile Programmer Dvorak?

I'm trying to compile the open source project Programmer Dvorak. The problem is that it's a bit old and doesn't build with the current versions of the build tools. You can see the full source code with modifications I made online at my project's Google Code page. Revision 2 is the unmodified source files from the original project. Revis...

How do I keep a constant definition in a header file and not have it linked into every library?

Here's the scenario. We use Visual C++ 9. There's a C++ library intended to be used by many other libraries. Its interface is in a header: #pragma once //CommonLibraryHeader.h CSomeClass GetSomeClassFunction(); //is defined in some .cpp file const CSomeClass MagicValue( 100, 200 ); //some predefined value that the previous function ret...

g++ linking order dependency when linking c code to c++ code.

Prior to today I had always believed that the order that objects and libraries were passed to g++ during the linking stage was unimportant. Then, today, I tried to link from c++ code to c code. I wrapped all the C headers in an extern "C" block but the linker still had difficulties finding symbols which I knew were in the C object archiv...

Compile Error IcePy (Ice 3.3.1) : relocation against local symbol

Hello all, I have a problem when I try to build IcePy (from Ice 3.3.1) (for python 2.4.4). Compilation, testing and install of Ice itself (cpp version) is OK but when I tried to build the python interface ("py" directory) I get the following error (sorry for the truncated paths) : .../lib/python2.4/config/libpython2.4.a(abstract.o): re...

Is there any way to deduce link flags from headers ?

Let's say I know that some of my C/CPP files include certain headers - is there any reliable information against which libraries I will have to link, other than guessing ? For example, if I have something like #include "foo.h" and want to find libfoo_abcdef_123.so Is there any 'best practice' how to do that, any place where to lo...