134 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
61
views
Does the linker option -Wl,-rpath-link=dir need to be given for all the necessary library dependencies search paths?
I have the following project structure, where libb.so depends on liba.so, libc.so depends on libb.so and libd.so depends on libc.so
abcd
├── a
│ ├── lib.cpp
│ ├── lib.o
│ └── liba.so
├── b
│ ├─...
1
vote
1
answer
71
views
Gcc flag repetition of -Wl what does the linker actually do
I am currently working with a project that generates its compiler- and linkerflags by reading a configuration file.
The resulting linker-flags of interest are:
-Wl,--defsym=__MPLAB_BUILD=1${...
3
votes
1
answer
73
views
NASM+WCC+WLINK (OW 1.9): strange error addressing CONST data (wrong/even addressing)
I'm porting a tiny experimental 80286 kernel from pure assembler (NASM) to assembler+C (NASM+Open Watcom 1.9). Boot sector code loads the BIN kernel image at address 0x010000 and then jumps to that ...
2
votes
1
answer
130
views
How to prevent unused functions from being opted out by linker/compiler?
I want to test code coverage of my tests over library L.
Let L::foo() be a function in L that I do not use in my tests.
Therefore the object code of foo() is removed/opted out I think by the linker ...
2
votes
1
answer
144
views
gcc 11 on Ubuntu 22.02 not linking library constructors
How can I figure out why gcc is failing to link my library (with only a lib constructor) when built with GCC 11 on Ubuntu 22.04?
I set up a tiny example here to try to replicate the problem: https://...
1
vote
1
answer
442
views
What is the actual cause behind the error "Assertion failed: alias and its target must be located in the same section" when building an iOS app?
I have a hybrid app created with Ionic that was originally running on Cordova, but we moved it to Capacitor a year ago and everything has been working as expected. Recently, while trying to make ...
0
votes
1
answer
706
views
collect2: fatal error: cannot find ‘ld’ compilation terminated. , binutils installed
I had been working on generation of shared libraries, while installing linpack i accidentally replaced cp linpack-fpm/lib/liblinpack.a /usr/bin/ld , I had tried referring to various solutions like ...
0
votes
0
answers
67
views
Re-exporting an import with gcc/llvm linker
I'm trying to re-create MSVC's behavior of the /export:myfunction=upstreamlib.myfunction linker flag in gcc/llvm (specifically Rust but I think this is a linker question rather than rust) which ...
1
vote
1
answer
468
views
Improve g++ compiler flags for debug and release
I am making a game in c++ with sdl2, and I am currently compiling the program with g++ using the following flags:
DEBUG_FLAGS = -g -Og -DDEBUG
RELEASE_FLAGS = -O3 -DNDEBUG -mwindows -s
I want the ...
1
vote
0
answers
50
views
Windows CMD shows from a custom package even with -H windowsgui flag
Initially my module consisted of both backend and frontend. When putting into an executable, cmd opened up, but with the -ldflags "-H windowsgui" it went away. Eventually, I wanted backend ...
2
votes
1
answer
150
views
Why is it okay to create this shared lib without -l flags for dependencies?
The rules regarding linking are getting jumbled in my head.
I have this little C file that I want to turn into a shared library. For the purpose of illustration, I'm calling a libuv function, but it ...
2
votes
1
answer
389
views
How should I conditionally set -isystem and -L flags in CMake?
I have a project that is to be compiled for Linux and Windows. Compilation for the former is done in a Linux environment, and compilation for the latter is done in w64devkit, i.e. I don't need to ...
1
vote
0
answers
210
views
CGO compilation error: invalid flag in go:cgo_ldflag: -Wl,--enable-stdcall-fixup
In the past, this call worked fine to compile a 32 bit version of my app for Windows (using cygwin/mingw). Now I get an error:
CGO_CFLAGS="-I/Users/Volker/src/includes/third-party/
-I/...
0
votes
0
answers
83
views
Why few of my symbols don't appear in my .so file? [duplicate]
I am creating an Android native application, where I have many cpp files and few kt files. With the use of cpp files, I am compiling static libraries which gives me .a extension files and as a whole I ...
0
votes
1
answer
1k
views
How do you add paths to libraries for cmake when using the ninja generator and the LLVM compilers?
My main goal is to use cmake with the ninja generator to build a C++ project with the LLVM clang compiler.
I am trying to get two libraries linked so when cmake tests the compilers, the compilers will ...