Questions tagged [linker-flags]

Linker flags are arguments passed to a linker to specify options, for instance to link the code with a certain library, etc

125 questions
2
votes
0 answers

go/docker : Cannot burn value to binary executable using -X linker flag when using docker compose

I can't seem to figure out how to provide a build time variable using the docker-compose file. I have done quite a bit of research and still can't figure the way out. What I'm trying to do is to burn my latest commit hash as a value to the version…
Athfan
  • 125
  • 8
2
votes
1 answer

What's the syntax for LIBS environment variable?

There is a LIBS environment variable for mpicxx. But the man page only says Libraries added when invoking the linker I wish to know detailed syntax for this variable, for example, should we prefix -L before directory, should we just write the…
zzzhhh
  • 291
  • 3
  • 10
2
votes
1 answer

How can I force ld to link against static library

I'm trying to create a shared library object (which will be loaded into R using dlopen) which links to the static rather than the dynamic version of a third-party library. (The goal is to have one rather than two shared libraries that the user…
ralmond
  • 116
  • 5
2
votes
0 answers

Executables developed in c++ contains Filenames in readable text

We develop c++ applications using MSVC2019. Opening the exceutable in a text editor shows filenames of source files with absolute path are embedded in the exe file. How can I get rid of that filenames to hide private data from my local computer…
wre
  • 21
  • 2
2
votes
2 answers

Difference between add_compile_options and add_link_options also flags each option supports

I've been using a .bat file to build my applications for years. Recently, switched to CMake for it's elegancy and I ran into a situation where I had to guess the flags that I should put into CMake's add_link_options and add_compile_options Example…
jeffbRTC
  • 1,941
  • 10
  • 29
2
votes
1 answer

What is the difference betwen --export-dynamic and --export-all-symbols?

After compiling on Cygwin with gcc or clang, ld complains about /usr/bin/ld: warning: --export-dynamic is not supported for PE+ targets, did you mean --export-all-symbols? Changing the linkerflag as suggested fixes this behavior, but I am not sure…
user69453
  • 1,279
  • 1
  • 17
  • 43
2
votes
2 answers

Having defines in linker script for memory origin and length

MEMORY { RAM (rxai!w) : ORIGIN = 0x80000000 LENGTH = 34K } Lets say I have a section in linker script like above. can i have a define for 0x80000000 and 34K. I want it to look like, MEMORY { RAM (rxai!w) : …
Thomas
  • 489
  • 1
  • 8
  • 13
2
votes
0 answers

Force linker / C compiler to include defined but unused inline functions?

My project consists of one .c file and a math library in one .h file, with all functions declared inline. Not every function in the math library is used in the main program. These functions are not compiled into the executable. However, some of the…
japreiss
  • 11,111
  • 2
  • 40
  • 77
2
votes
1 answer

Can I hide my link flags from users of my conan package?

Let's say I have a library uploaded as a package in conan, which uses OpenGL, and as such links with GL in the CMakeLists.txt. Do the users of the library need to explicitly link against GL again? Does conan provide a method to track it and include…
jmmut
  • 884
  • 9
  • 19
2
votes
1 answer

_cvLoadImage undefined symbols linking issue

i am compiling conv-net (http://conv-net.sourceforge.net/) deep learning library opencv and c++ on my mac osx and i cant seem to get through this error. This seems to be a linking issue. All the opencv libraries are compiled for 64 bit, i tried…
pbu
  • 2,982
  • 8
  • 44
  • 68
2
votes
2 answers

Find function/variable definition for a reference in source code

My project contains many files. Sometimes I need to know where a particular function is defined (implemented) in source code. What I currently do is text search within source files for the function name, which is very time consuming. My question is:…
aiao
  • 4,621
  • 3
  • 25
  • 47
2
votes
2 answers

Combining FORTRAN and C++, linking error

I should couple in linux one c++ code with old fortran code, where fortan is the main code. Im not expert in this area and I try to start with simple test, but still I cannot compile it. Maybe I'm stupid, but I cannot find a working example…
2
votes
1 answer

what is the json-spirit linker flag for g++?

I can't find this anywhere. I've installed json-spirit on my ubuntu server with apt-get install json-spirit-dev. What linker flag has to be used with g++ to use json-spirit?
user1382306
1
vote
1 answer

Pybind11 build with poetry

I am currently trying to build a small pybind11 extension and to integrate smoothly with our current setup, it would be neat if that would work with poetry build && poetry install from pybind11.setup_helpers import Pybind11Extension, build_ext def…
1
vote
0 answers

How to force a static library at a specific memory address

I am building some applications that use a static library and I would want to force linker to put .text and .data sections of the static library (.a file) at specific addresses using GNU linker but I couldn't find a way how the linker script can be…
1 2
3
8 9