Skip to content
Advertisement

Tag: linker

Keep gcc linker from using non-system libraries found in system /lib64 folder

I am porting a large C++ library (libcoro.so) and example application (coro-example.cpp) from Windows to RedHat Linux 7.4. I have very little development experience on Linux, so this is probably a ‘newbie’ question. I have libcoro and the example app compiling, linking, and running on my RHEL 7.4 VM. However, the gcc linker fails to link the app on the

g++ undefined reference error when linking to third party shared libraries

I’m trying to link a c++ program that uses several shared libraries from 3rd parties. Mainly, these libraries come from a github project called MBSim and I downloaded the latest daily build with all its binaries, libraries and headers, which I installed on /usr/local/mbsim-env. The most important libraries called are libmbsim, libopenmbvcppinterface, libfmatvec and libboost_filesystem (the last one comes with

g++ can’t link curl lib files

I’m having some issues with getting g++ to link the curl lib files. I’m using Visual Studio 2017 with the linux dev plugin and Ubuntu Server 17.04. curl-config –libs gave an output of -Lcurl which I tried adding to the linker options in Project settings > Linker > Command Line > Additional options. I also added the –cflags output to

ELF, Build-ID, is there a utility to recompute it?

I came across this useful feature in ELF binaries — Build ID. “It … is (normally) the SHA1 hash over all code sections in the ELF image.” One can read it with GNU utility: And I wonder if there is an easy way to recompute Build ID yourself? To check if it isn’t corrupted etc. Answer So, I’ve got an

CMake linking glfw3 lib error

i’m working with CLion, and I’m writing a program using the glfw3 lib.(http://www.glfw.org/docs/latest/) I installed and did everything correctly for the lib i have the .a and .h files in: I’m trying to use the library now, but i’m getting the linker error: undefined reference to ‘glViewport’ etc. etc. all the functions i’m using I added the lib path to

ld cannot recognize the options

I’am reading this Tuto, and I’am trying to link the application using this command: ld test.o –o test.bin, the linker doesn’t recognize the -o option : Using ld -help the option -o exist but i don’t understand why I’am getting this problem. This is the linker version. Answer My good eyes and my bitter experience tell me that you must

What are the recommended GNU linker options to specify $ORIGIN in RPATH?

Assume my platform is vanilla (non-embedded) x86-64 Linux using GNU build toolchain (GCC, etc.). To specify $ORIGIN in RPATH, I know about the linker option: -Wl,-rpath,’$$ORIGIN’. Today, I discovered another option: -Wl,-z,origin. Should I always include -Wl,-z,origin when using -Wl,-rpath,’$$ORIGIN’? Official GNU ld docs, say: Marks the object may contain $ORIGIN. Related, but different: https://stackoverflow.com/questions/33853271/what-are-the-recommended-gnu-linker-options-to-specify-rpath Answer I know about the

Advertisement