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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

Two const variables with same name in 2 independent .cpp file will lead to a link error?

Thanks for reading my question. I understand that by default const objects are local to a file and the key word extern would be the best practice to share a variable across different files. Chatgpt ...
Yiqun Cui's user avatar
1 vote
1 answer
33 views

C++ linker options for RPATH of linked library

I have a MyApp project which is dependent of lib1.so library. lib1.so has own dependency lib2.so: MyApp -> lib1.so -> lib2.so I want to run MyApp with all dependencies in one directory. For ...
Kosterio's user avatar
  • 121
0 votes
0 answers
19 views

How to add several external library files to Visual Studio

The Goal I would like to include 3rd party library headers/source files in my VS project and compile them alongside the rest of the project. Background: I have created a project in Visual Studio using ...
Misha's user avatar
  • 546
1 vote
1 answer
53 views

How to tell linker not to look for certain symbols in a linked shared library?

My situation is as follows: our program depends on a ton of shared (and static) libraries. I want to add a new dependency, which is a static library. The program compiles with no issues, but it ...
Romário's user avatar
  • 1,682
1 vote
2 answers
47 views
+300

Find the call chain that causes a function to be linked in

I'm working on an embedded system and while analyzing the binary with nm I find a lot of symbols from standard library functions such as: 00001524 std::time_get<char, std::istreambuf_iterator<...
Florian Humblot's user avatar
-1 votes
0 answers
32 views

-l option in gcc - C linker [duplicate]

I am a beginner on C programming language. I was writting a C program with libcurl. on compiling stage, i faced with this error: "undefined reference to `__imp_curl_easy_init'" I search on ...
Empire's user avatar
  • 1
1 vote
0 answers
12 views

Isn't `-no-plt` always preferrable to `-z now`?

I know that keeping the GOT writable in an ELF program throughout execution is a glaring attack surface and understand that it was decided to avoid it by defaulting to -z relro and sometimes -z now (...
Ofek Shilon's user avatar
  • 14.9k
0 votes
1 answer
38 views

I'm facing this linker command issue in the SwiftUI [duplicate]

Linking failed: linker command failed with exit code 1 (use -v to see invocation) ld: warning: search path '/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator' not found ld:...
Ninja's user avatar
  • 63
1 vote
1 answer
43 views

Clang uses a linked shared lib to decide which symbols to export?

Take this toy code for an executable and a shared library: // main.c void foo() {} int main() { return 0; } // bar.c void foo(); void bar() { foo(); } Let's build without optimizations, first with ...
Ofek Shilon's user avatar
  • 14.9k
-1 votes
0 answers
30 views

Unable to fix sfml linking error "main.o:main.cpp:(.text+0x7c): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale"

So I was setting up sfml with c++ but when I built the main file it outputted an error Error main.o:main.cpp:(.text+0x7c): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale' main.o:main.cpp:...
Joshua Kadji's user avatar
1 vote
1 answer
28 views

How does the linker assign anything to ITCMRAM on STM32 H7 series Arm Cortex M MCU?

How does the linker assign anything to ITCMRAM on STM32 H7 series Arm Cortex M MCU? The linker script provided by ST has a section defining ITCMRAM: /* Memories definition */ MEMORY { ITCMRAM (...
SRobertJames's user avatar
  • 8,403
0 votes
1 answer
11 views

Linking external DKM (.o file) with the DKM project in WindRiver workbench 4.1

I want to link my external .o file (source code not available) with the VxSim based image project in Workbench. I am able to load this .o file as a module and run it. However, since it is an external ...
Vishal Pal's user avatar
1 vote
1 answer
55 views

How to add padding to a [sub]section in linker script to fill a specific size

I have a stm32f4 mcu with 512 KB of flash memeory. The flash memory is divided in different sections as below: I've dedicated the first 16KB section to bootloader. The bootloader executable is ...
mehdi's user avatar
  • 185
1 vote
0 answers
53 views

How can I set an "end of code" marker at the end of my binary?

I have a GNU linker script for my firmware with the following section defined: .endc : { KEEP(*(.endc)); . = ALIGN(4); _end_code_mark = .; } >FLASH This is the last time I'm ...
kokopelli's user avatar
  • 218
0 votes
0 answers
24 views

Is it possible to use a linker script with Apple ld64 linker?

As in the title, can you use a linker script with Apple ld64 linker? I mean an option similar to -T of GNU ld.
mrn's user avatar
  • 1,001
0 votes
1 answer
19 views

REACT app gives CSP header error and stops accessing my flask backend endpoints

I have a flask backend hosted on render, its a very simple, the endpoints work in both browser and in postman. I'm new to REACT and I'm trying to access those endpoints in a REACT app I'm working on, ...
Rex's user avatar
  • 1
0 votes
0 answers
18 views

why linker looks for LIBCMT.lib in x86 directory instead x64?

SETUP Windows 10 GOAL I found a library libnodave to communicate through S7-protocol I'm trying to build examples on x64 architecture through edited makefile ISSUE Even though I set directories ...
PiotrBzdrega's user avatar
0 votes
0 answers
29 views

Executable in a non-ROS workspace links to an executable in a ROS workspace

I'm working in ubuntu 20.04 and have ROS noetic. I have a catkin workspace (catkin_ws), and it has DBow2 in it at /home/glenn/catkin_ws/devel/lib/libDBoW2.so. I also have the library ORB-SLAM3 ...
User_0603's user avatar
0 votes
0 answers
25 views

Ubuntu cross compiling: install host or target dependencies in sysroot?

I'm trying to cross-compile an application for arm64 on Ubuntu 20.04 that depends on 3rd-party libraries like grpc. I think I need to install those dependency libraries in my cross-compiler's sysroot, ...
TS_'s user avatar
  • 75
0 votes
1 answer
47 views

C compiler creates .obj files from .h files

Should C Compiler (I use Visual Studio) generate .obj files from .h files? I think it shouldn't, but my compiler creates them. How do I fix it? There is no .c files except Main.c
Yurix's user avatar
  • 15
0 votes
0 answers
11 views

Making Sections Absolute / Not-Relocatable in a Linker Script

I am trying to write a linker script such that certain sections will be relocatable and other sections will be not. I am aware of the -r flag, which makes all sections relocatable. However, for a ...
WodkaRHR's user avatar
0 votes
1 answer
33 views

Why does unity wont let me do IL2CPP build

I got a problem in unity that wont let me to do build. This is my error log : Building C:\Users\Chenr\Documents\Unity Projects\NewMada\MDAProject\Library\Bee\artifacts\unitylinker_dwek.traceevents ...
Chen Robin's user avatar
0 votes
0 answers
15 views

Trouble in linking code to an object file of an assembly language

I was able to successfully make an object file of a sic assembly program The command i did for that was java -cp sictools-java.jar sic.Asm a.asm But i am having trouble in linking it To run linker ...
Midhun Raj's user avatar
-1 votes
1 answer
83 views

Build or Linker order in Microsoft Visual Studio 2022 [duplicate]

This is a question about Microsoft Visual Studio 2022 I have multiple files A.h and A.cpp, B.h and B.cpp, and finally, C.h and C.cpp. A.h class A { private: A(); static A* Instance; } A.cpp ...
Gijahara's user avatar
-1 votes
1 answer
57 views

How to link with a shared library installed in a custom directory by another yocto bitbake recipe

I have two bitbake recipes a.bb and b.bb The recipe a.bb installs a shared library libABC.so in a custom path /opt/app/lib. The recipe b.bb generates a binary that needs to link with the libABC.so. I ...
Amit Kumar's user avatar
-1 votes
0 answers
30 views

Including <iostream> causes "Error LNK2038 : mismatch detected" when done in one file but not in another [duplicate]

I have a project that has 4 classes, all with .h and .cpp files main block mesh chunk main.cpp includes chunk.h chunk.cpp includes block.h and mesh.h The project is configured to be built as an ...
Amakazor's user avatar
-2 votes
0 answers
25 views

Issues with C++ Templates [duplicate]

I am trying to create an abstract interface for Trees using c++ templates. I am facing some issues with it. Here is the code I have written: tree.h #ifndef __TREE_H_ #define __TREE_H_ template <...
Ricky's user avatar
  • 631
0 votes
0 answers
18 views

Compile gdb for os161 on Archlinux

I started following the os161 course, from ops-class, and I'm having trouble setting up part of the tool-chain required to do the exercises. I tried to follow the setup guide and managed to: install ...
cloud's user avatar
  • 1
1 vote
1 answer
50 views

Can I enforce a linker warning/error when multiple symbol definitions are present?

Assume I have liba.so and libb.so and both define a symbol foo. For better comprehension, let's assume both libraries are compiled from a single file each and foo is a C function like this: int foo(...
andreee's user avatar
  • 4,489
0 votes
0 answers
45 views

LINK : fatal error LNK1117: syntax error in option 'LTCG:incremental'

I have a C++ project. Which is based on v120. I retargeted the proj to v140 and I get the below error while building. LINK : fatal error LNK1117: syntax error in option 'LTCG:incremental' How to fix ...
Ankitha Pilli's user avatar
0 votes
0 answers
18 views

Migrating VS2012 Project to VS2022 ==> Getting Linking errors, seems that directory can't properly parsed

I migrate a VS2012 proj into VS2022 proj and was able to solve a lot of problems. I'm in the last step which makes me trouble. It looks like that the linker can't parse the directory for specific dll'...
Dirk's user avatar
  • 121
0 votes
1 answer
16 views

Does anyone know about the Static Shared Library?

Does anyone know about the Static Shared Library? Please describe the difference between it and the static library, and the difference between it and the shared library. My own understanding is that ...
Yue Zhou's user avatar
0 votes
0 answers
10 views

Issues Linking gdi32 library for GLFW on MinGW-W64

I am having the follow error building with my makefile: g++ -Wall -o build/chess-gui src/*.cpp src/vendor/glad/src/glad.c -Isrc/ -Isrc/vendor/glad/include -Isrc/vendor/glfw/include -Lsrc/vendor/...
Matthew Whalen's user avatar
-1 votes
0 answers
46 views

Difference between arm-none-eabi compiler versions

I am trying to cross compile from Linux x64 to an embedded arm device (AT91SAM7X) with cmake. Whats the difference between the following 2 toolchains? gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-...
philipp kreuzbichler's user avatar
0 votes
0 answers
28 views

How to fail CMake+Clang build in case of unresolved symbols?

I am trying to check that my shared libraries and executables have no unresolved symbols before running them. As far as I know it is done by adding compiler option -Wl,-z,defs, see this answer. My ...
Fedor's user avatar
  • 17.3k
-1 votes
0 answers
32 views

c++: Can linkage be proponed into compile time of object?

I am unable to find the correct cmd command for g++ such that I can compile a source file into an object file with all its necessary linkage preemtively. Example I have three files: foo.hpp declares ...
Darika Ranganathan's user avatar
0 votes
0 answers
21 views

How to code pthread/thread library function in AURIX TC275 in AURIX Development Studio?

I am new to coding Tricore and AURIX Development Studion. I am trying to create a thread to execute a separate function but i am not able to link the thread function. I tried to link the thread ...
Rpk's user avatar
  • 11
0 votes
0 answers
4 views

Does anyone know of a tool that links to my regional Amazon Review Page?

I'm not a programmer. The closest I've come to understanding code was writing in Basic on my Commodore many years ago. I'm an author. What I'd like to find is a tool that will create a link whereby my ...
tudogz's user avatar
  • 1
0 votes
0 answers
37 views

Default linker files and sections: Explain their origin/history and their purpose

I have a Linux Ubuntu(20.04) machine with gcc and clang installed. I figured out the directory containing the default linker script: /usr/lib/x86_64-linux-gnu/ldscripts$ ls elf32_x86_64.x ...
Self's user avatar
  • 115
0 votes
1 answer
45 views

Why do I get an undefined reference to a symbol that is defined in the library I am linking?

I was trying to compile an unrelated project when I got an undefined reference when using a specific function of the Raylib library. I was able to reproduce this behaviour using the following test.c #...
Alaric de Ruiter's user avatar
0 votes
0 answers
23 views

Dynamic library in main ios app target builds with no symbols, when debugging the widget extension

I have a SwiftUI iOS app with widget extension. I have extracted a common code into a framework, and have set it to build as a dynamic library. The framework is embedded (embed & sign) in the main ...
Tomáš Kafka's user avatar
0 votes
1 answer
23 views

CMake cannot find GLEW library

I have an issue with building CMake project with GLEW. Following the solved issues with similar names on this site, I have landed on the following CmakeLists.txt: set(GLEW_DIR "ext/glew-2.2.0&...
ingotangjingle's user avatar
1 vote
1 answer
30 views

thumb_func directive is not accounted for

I'm trying to assemble a small application for STM32F103 with bare assembly and linker script. Here's what I've come up with: linker.ld: MEMORY { FLASH : ORIGIN = 0x08000000, LENGTH = 64K SRAM ...
vbezhenar's user avatar
  • 11.5k
-1 votes
0 answers
18 views

GitHub Actions CI/CD referencing incorrect .dylib file

I am setting up GitHub Actions for my project, which runs bazel build ... and bazel test ... for every pull request. The build component of the CI works but the testing component does not. The reason ...
Desmond Chi's user avatar
0 votes
0 answers
31 views

static vs dynamic library linking case study: why does Minecraft dynamically link lightweight libraries e.g. GLFW?

I'm learning c++, currently trying to understand how to link libraries. The benefits of dynamic libraries I know of are: smaller binaries of final products, reusability (multiple applications can use ...
BogdanB's user avatar
  • 139
0 votes
0 answers
25 views

How do I call lib file entry points that don't have underscore

I'm using the pre-built binaries for OpenSSL Win64, and in the lib files they have methods such as SSL_write. When I call SSL_write in my Visual C++ code and do a Build, the linker says it can't find ...
Don Payette's user avatar
0 votes
0 answers
102 views

What is the Initial Values of IAT (Import Address Table) Stand for?

In PE header, there are import directory which describes where the loader should bind the imported symbols. More precisely: typedef struct _IMAGE_IMPORT_DESCRIPTOR { union { DWORD ...
imakak's user avatar
  • 188
-2 votes
1 answer
62 views

static member of dynamic library can not be initialized on Linux(GNU GCC) but can initialized on macOS (Clang)

It seems that the linker of gnu drop test.cpp since that there is no reference in main.cpp. But I really need to initialize some static variable like this in my project. // main.cpp #include "...
XY_cpp's user avatar
  • 13
1 vote
2 answers
55 views

Link time error with ndarray-linalg with mkl-stats on Windows

I'm struggling to understand why this doesn't link on windows use ndarray::{arr2, Array2, ArrayView2}; use ndarray_stats::CorrelationExt; pub fn covariance<'a>(asset_returns: &ArrayView2<...
Delta_Fore's user avatar
  • 3,111
0 votes
0 answers
7 views

libraries mismatch between application and plugins

I have an application (imsd server) that dynamically loads a plugin I'm maintaining, that's releases as a shared library. The whole thing is running on Centos7.3.1611 The problem apparently is that ...
irio lavagno's user avatar

1
2 3 4 5
279