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.
linker
14,167
questions
0
votes
0
answers
13
views
LLVM linker does not work on MacOS while trying to develop on-chain Solana app (C++)
this is the error i get:
./account_logger.so ()
dyld[61282]: Library not loaded: @rpath/libLLVM.dylib
Referenced from: <A9E4BE2A-BF8D-3956-BCA9-E3BC5A6C9F9C> /Users/myusername/.local/share/...
1
vote
2
answers
60
views
Does including a header obviate the need for extern declarations?
On page 33 of K&R (The C Programming Language, 2e), they remark that
If the program is in several source files, and a variable is defined in file1 and used in file2 and
file3, then extern ...
0
votes
0
answers
50
views
C++: ODR and extern "C" on MSVC linker
I'm testing out how the Windows link.exe program reacts when presented with ODR violations. My intention is that the linker will fail when it notices that my program has two definitions of the same ...
0
votes
0
answers
8
views
Understanding GCC Compilation: Preprocessing vs Linking with Libraries
I have a question regarding compilation with GCC.
I have a slight confusion that I believe I've figured out but would like confirmation on. In the first compilation step, preprocessing (cpp) organizes ...
0
votes
1
answer
14
views
Strange linking problem when `dlopen` a library
I have some strange linking problem with a library which is dynamically loaded using dlopen.
Precisely, I have a code that loads a library libmine.so (which is part of the code) that depends on Intel ...
0
votes
1
answer
14
views
STM32CubeIDE: How to exclude memory sections in linker script from output file
In my cube project, I need to generate a bin file as the output. The output bin file is over 2GB because it includes a RAM section (0x30000000) in the output as well as the required flash section (...
1
vote
1
answer
65
views
Setting Preprocessor Definitions in a referenced project
I would like to conditionally export symbols to be used in a Google Test project in Visual Studio 2019. I am trying to set a preprocessor definition called UNIT_TESTS, but only when the unit test ...
0
votes
0
answers
10
views
MSVC Linker: /NODEFAULTLIB and /DEFAULTLIB option
I noticed that the MSVC linker from Microsoft has among many other options these two options: /NODEFAULTLIB and /DEFAULTLIB.
The documentation says:
By default, /NODEFAULTLIB removes all default ...
-1
votes
0
answers
24
views
How to run an LC-3 Assembly program
I am creating an LC-3 Assembly program. I have managed to assemble it into an obj file. I'm not sure what linker to use / what arguments to use from here. Any help would be much appreciated.
I tried ...
0
votes
0
answers
15
views
How does the dynamic linker resolve symbols at run time?
I'm trying to understand how the dynamic linker resolves symbols at run time. I read chunks (but not all) of David Beazley et. al's The Inside Story on Shared Libraries and Dynamic Loading, but I don'...
0
votes
0
answers
19
views
Build failure on Msys2/ming64 environment by clang with clang64/bin PATH
On Msys2/ming64 environment, tried to build stockfish by use of clang/llvm, as PATH:
clang64/bin precedes over mingw64/bin
use flags:
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++17 -pedantic ...
-2
votes
0
answers
40
views
cmake change order of option linker [duplicate]
My program use libusb-1.0. If I run compile command:
g++ async.c -lusb-1.0 -o async
all OK
If I run compile command:
g++ -lusb-1.0 async.c -o async
get error
/usr/bin/ld: /tmp/ccNWWieW.o: in function `...
1
vote
0
answers
31
views
Link function calls against reverse engineered binary
I created an windows x86 .exe file that I reverse engineer. Imagine I only have the .exe file and I reverse engineered some functions.
The goal is to create a dll that links with this .exe so the dll ...
-1
votes
1
answer
14
views
Unresolved external symbol: static function declared in class defined in cpp file
my code looks like this:
//Renderer.h file
#pragma once
class Renderer {
public:
static int Test();
};
//Renderer.cpp file
#include "../Header/Renderer.h"
#include <iostream>
int ...
-1
votes
1
answer
32
views
Which is the effect of switching between Debug and Release for a CMake project in Visual Studio Code?
What I want to accomplish is to link libraries of the same name but from different paths.
Currently I'm helping myself with
link_directories(${FOREIGN_DIR}/arch/win32/apil/access/x64/${...