linker

Linux equivalent of Windows DLL forwarders or MacOS reexport_library

◇◆丶佛笑我妖孽 提交于 2019-12-20 02:12:31
问题 I have a shared library that tries to provide a standardized interface, basically a list of functions. Some of these functions are already provided by another shared library. So I could just write the additional functions and ask the user to link to both libraries, i.e. have him do this: g++ foo.c -lmine -lother In order to make things easier for the user, however, I don't want to do that. (Given the situation I'm in, this would be way more complicated than just adding a flag in some script.)

Linking a dynamically linked executable with ld

和自甴很熟 提交于 2019-12-20 01:52:14
问题 i'm trying to create a dynamically linked executable (elf_i386) without gcc. The program is very simple (only a printf)...here the commands: $ gcc -c simple.c $ ld -o simple -dynamic-linker /lib/ld-linux.so.2 --entry main /usr/lib/crt1.o /usr/lib/crti.o simple.o -lc /usr/lib/crtn.o The executable is created and also file command and ldd command show the right output... However when i launch the program after the call to printf i get a segmentation fault...i've examined with objdump the

Missing symbols from static library in linked executable

主宰稳场 提交于 2019-12-19 19:42:33
问题 I have a problem with static library symbols missed in linked executable. Here is the description of my problem: I have static library built from several object files. These object files provides sevaral groups of symbols, associated with: A set of C functions and structs (several object files). Let's call corresponding symbols level1 symbols. A set of C++ wrapper classes for this C functions and structs (another object file). Let's call corresponding symbols level2 symbols. A set of C++

LNK2005 Error linking static openCV libraries with Visual Studio and QT Creator

假装没事ソ 提交于 2019-12-19 19:03:39
问题 I built the static openCV 2.3 libraries. My project currently uses the dynamic ones with no problem, but now I want to use static libs. I added the libs to my .pro file: LIBS += "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv_calib3d231.lib" \ "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv_contrib231.lib" \ "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv_core231.lib" \ "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv

LNK2005 Error linking static openCV libraries with Visual Studio and QT Creator

…衆ロ難τιáo~ 提交于 2019-12-19 19:01:13
问题 I built the static openCV 2.3 libraries. My project currently uses the dynamic ones with no problem, but now I want to use static libs. I added the libs to my .pro file: LIBS += "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv_calib3d231.lib" \ "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv_contrib231.lib" \ "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv_core231.lib" \ "C:\Program Files\openCV_VS_static\opencv\build\lib\Release\opencv

What do linkers actually do with multiply-defined `inline` functions?

孤街醉人 提交于 2019-12-19 17:36:33
问题 In both C and C++, inline functions with external linkage can of course have multiple definitions available at link-time, the assumption being that these definitions are all (hopefully) identical. (I am of course referring to functions declared with the inline linkage specification, not to functions that the compiler or link-time-optimizer actually inlines.) So what do common linkers typically do when they encounter multiple definitions of a function? In particular: Are all definitions

Could not exec the linker `cc` error when running “cargo build”

青春壹個敷衍的年華 提交于 2019-12-19 15:47:02
问题 I just installed Rust on my Mac and rustc --version --verbose displays rustc 1.0.0-nightly (91bdf23f5 2015-03-09) (built 2015-03-08) binary: rustc commit-hash: 91bdf23f504f79ed59617cde3dfebd3d5e39a476 commit-date: 2015-03-09 build-date: 2015-03-08 host: x86_64-apple-darwin release: 1.0.0-nightly I cloned a couple of repositories (postgres-extension and erlang-rust-nif) and ran cargo build upon both of them. Both reported the error error: could not exec the linker `cc`: No such file or

Could not exec the linker `cc` error when running “cargo build”

笑着哭i 提交于 2019-12-19 15:46:43
问题 I just installed Rust on my Mac and rustc --version --verbose displays rustc 1.0.0-nightly (91bdf23f5 2015-03-09) (built 2015-03-08) binary: rustc commit-hash: 91bdf23f504f79ed59617cde3dfebd3d5e39a476 commit-date: 2015-03-09 build-date: 2015-03-08 host: x86_64-apple-darwin release: 1.0.0-nightly I cloned a couple of repositories (postgres-extension and erlang-rust-nif) and ran cargo build upon both of them. Both reported the error error: could not exec the linker `cc`: No such file or

Visual C++ Library Directories Command Line equivalent

懵懂的女人 提交于 2019-12-19 15:40:35
问题 To use some recompiled libraries (f.ex. boost chrono) i need to specify the library folder in visual studio at Properties -> VC++ Directories -> Library Directories. How can i achieve this using the command line? I have been using the /LIBPATH but i get linker error (LNK1104). 回答1: You need to specify /link <linkoptions> for cl.exe command line to pass the required settings to the linker: cl -I "path\to\Boost" test.cpp /link /LIBPATH:"C:\path\to\Boost\stage\lib" 来源: https://stackoverflow.com

Xcode 4 and Allegro 5.1 - Linker can't find Framework

泄露秘密 提交于 2019-12-19 11:36:13
问题 I know there are several other questions here regarding the Linker and Xcode 4, but they don't really relate to my problem. I've built Allegro 5.1 and it took me a while because of FreeType, but eventually it worked. Now I've written a little Space Invader game using Allegro. But somehow the linker can't find the framework. What I've done so far: The Frameworks are located at /Library/Frameworks/ and they have the same structure like all the other frameworks in that place I've added the