Questions tagged [linker]

The linker is part of the toolchain for producing executables from source code written in compiled programming languages. It takes compiled object code in multiple files and produces a single, "linked", executable file from them.

Separately-compiled programming languages such as C and C++ rely on a linker to turn one or more object files and libraries into an executable. The linker resolves undefined symbol references in object files by linking them to symbol definitions in other object files and libraries. The linker also arranges variables and functions to assign them addresses in the final executable,

On Unix-like operating systems the linker is typically named ld and is often invoked automatically by the compiler as the last step in the compilation process.

Books about linkers:

13907 questions
6
votes
3 answers

QT CREATOR - where do I put the /NODEFAULTLIB:library?

QT gives the errors LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library where do I put the /NODEFAULTLIB:library ?
rreeves
  • 2,408
  • 6
  • 39
  • 53
6
votes
3 answers

Undefined Reference to LAPACK wrapper of Armadillo

I have a question regarding the use of Armadillo. I'm using Ubuntu 12.10, and the gcc compiler in Code::Blocks. I installed LAPACK and BLAS using the synaptic package manager. I also installed Armadillo once using the synaptic package manager, once…
user2477647
  • 61
  • 1
  • 1
  • 3
6
votes
1 answer

Importing a symbol from C file into linker script

I have created a section called .co_stack in my C file and have an array called pulStack to define the area. #define STACK_SIZE 0x00003000 /*!< Stack size (in Words) */ __attribute__ ((section(".co_stack"))) unsigned long…
Vishal Sagar
  • 498
  • 2
  • 4
  • 13
6
votes
2 answers

linker error for ns_initparse

Here the code #include #include #include #include #include int main (int argc, char *argv[]) { u_char nsbuf[4096]; char dispbuf[4096]; ns_msg msg; ns_rr rr; int i, j,…
Bruce
  • 33,927
  • 76
  • 174
  • 262
6
votes
5 answers

Linkers and architectures

Why do we have linkers for different architectures? Service of the linker is to resolve addresses. So how it is related to the instructions of target architecture?
6
votes
1 answer

How to run a ghc compiled binary on other machines?

This post is really informative on what I'm trying to achieve. I produced a simple HelloUnix binary. $ echo 'main = putStrLn "Hello Unix"' > HelloUnix.hs $ ghc -static --make HelloUnix.hs Which created a HelloUnix binary, I was hoping with the…
HHC
  • 2,513
  • 2
  • 18
  • 26
6
votes
2 answers

What is the correct Xcode setting for Position Independent Executables

Just recently started getting a post appstore submission email with the following advice. Please ensure that your build settings are configured to create PIE executables. However the setting in XCode appears correct, In the linking section I found…
user2239244
  • 121
  • 1
  • 6
6
votes
0 answers

Distribute NDK Library with gnustl?

I am developing a library for Android which has both Java and Native components. The Native library depends on the GNU STL. I was linking against gnustl_static, but have ran into a few strange problems that were resolved by linking gnustl_shared.…
yano
  • 4,095
  • 3
  • 35
  • 68
6
votes
3 answers

Linking to Armadillo libraries with CMake

I am trying to install MLPack on windows 8. I configure the CMakeLists.txt file with: set(ARMADILLO_LIBRARY "C:\\Program Files (x86)\\armadillo\\lib") set(ARMADILLO_INCLUDE_DIR "C:\\Program Files (x86)\\armadillo\\include") Then when I ran CMake I…
Vince
  • 3,979
  • 10
  • 41
  • 69
6
votes
3 answers

The procedure entry point could not be located in the dynamic link library Core.dll

I am converting my project to use DLLs and am trying to break apart my Singleton class to avoid using templates. My class, LudoMemory, originally inherited from Singleton. I am trying to give it the functions to destroy and create itself now and…
user189320
6
votes
1 answer

C++ Linker error when using O1 optimization

In an already existing and quite large project, I'm enabling the gcc compiler optimization O1. Without this option, everything builds, links and runs fine. with the option enabled, the main executable compiles and links, but I get linker errors when…
Rob
  • 69
  • 2
6
votes
2 answers

FreeGLUT linking Issues in Linux

I am running Linux Mint 14.1 64-bit I have installed the following libs: mesa-common-dev, freeglut3-dev, libglew-dev through the apt-get tool. Here are my includes, located in my Main.h file: #include #include #include…
FinalFortune
  • 635
  • 10
  • 25
6
votes
3 answers

linux/gcc: ldd functionality from inside a C/C++ program

Is there a simple and efficient way to know that a given dynamically linked ELF is missing a required .so for it to run, all from the inside of a C/C++ program? I need a program with somewhat similar functionality as ldd, without trying to execute…
royconejo
  • 2,213
  • 3
  • 24
  • 29
6
votes
2 answers

Unresolved Symbols linking w/ Boost Serialization under Ubuntu 12.10

I'll start by stating I'm feeling like a moron tonight. I'm trying to minimally reproduce a work issue I have under RHEL5.6, gcc 4.1.2, boost 1.44.0, with Boost Serialization. The environment I'm having this issue with is Ubuntu Server (with dev…
Nathan Ernst
  • 4,540
  • 25
  • 38
6
votes
3 answers

Compiler error vs linker error?

Just reading Effective C++ and he mentions several times "linker error", as opposed to compiler error. What constitutes a "linker error" and how do they differ from "compiler errors"? Are the rules/explanations based around a set of categories to…
user997112
  • 29,025
  • 43
  • 182
  • 361