linker

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

♀尐吖头ヾ 提交于 2021-01-27 12:10:36
问题 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

extern “C” is not disabling name mangling

房东的猫 提交于 2021-01-27 07:52:41
问题 I am trying to use a C++ library in a C framework by implement a wrapper. I've seend that you need to declare functions as extern "C" in the header file. However, when I try to link my dynamic library, name mangling is not disabled, which results in undefined symbols when I try to use my wrapper. Here is the current header of my wrapper, SbeOtfDecoder.h : #ifndef ITF_SBEOTFDECODER_H_ #define ITF_SBEOTFDECODER_H_ // WARNING! In a C++ wrapper for C, any exception thrown by C++ code HAS TO BE

assimp-vc140-mt.dll ASSIMP was not found

 ̄綄美尐妖づ 提交于 2021-01-27 07:24:46
问题 I have downloaded the Assimp project from http://assimp.sourceforge.net/main_downloads.html Assimp release image assimp zip image And I've also downloaded the cmake x86 version from this link: https://cmake.org/download/ cmake x86 image I have extracted both, and made a build folder next to the assimp's folder. After that I have opened a command promt, changed the directory to the mentioned build folder. I gave the cmake.exe 's path to the command promt and the assimp folder's path as the

assimp-vc140-mt.dll ASSIMP was not found

送分小仙女□ 提交于 2021-01-27 07:23:36
问题 I have downloaded the Assimp project from http://assimp.sourceforge.net/main_downloads.html Assimp release image assimp zip image And I've also downloaded the cmake x86 version from this link: https://cmake.org/download/ cmake x86 image I have extracted both, and made a build folder next to the assimp's folder. After that I have opened a command promt, changed the directory to the mentioned build folder. I gave the cmake.exe 's path to the command promt and the assimp folder's path as the

Why does math.h need to be linked in makefile but not string.h? [duplicate]

一个人想着一个人 提交于 2021-01-27 07:07:00
问题 This question already has answers here : Why do you have to link the math library in C? (13 answers) Closed 7 years ago . I've been including <string.h> all over the place and the moment I go to include <math.h> for pow() I discover that I need to modify my makefile to get access to the definition of pow . I also do not know where I can look up more libraries if I need to include them. I randomly read that -lm flag (or at least the m of it) indicates the standard c math library, but I have no

Why does math.h need to be linked in makefile but not string.h? [duplicate]

大憨熊 提交于 2021-01-27 07:06:20
问题 This question already has answers here : Why do you have to link the math library in C? (13 answers) Closed 7 years ago . I've been including <string.h> all over the place and the moment I go to include <math.h> for pow() I discover that I need to modify my makefile to get access to the definition of pow . I also do not know where I can look up more libraries if I need to include them. I randomly read that -lm flag (or at least the m of it) indicates the standard c math library, but I have no

C++ template specialization definitions shared across files

穿精又带淫゛_ 提交于 2021-01-27 07:05:31
问题 I have a template class "Extra," defined in "extra.h," with a function "doSomething," and I have defined two specializations of "doSomething." Two different functions create objects of type "Extra," each with a different type parameter, and each calls a different one of the specializations. The two client functions, "client1" and "client2," are defined in two files, "client1.cpp" and "client2.cpp," respectively. In a third file, "main" calls "client1" and then "client2." Now, "client1.cpp"

Compile and Link to .com file with Turbo C

倾然丶 夕夏残阳落幕 提交于 2021-01-27 06:32:06
问题 I'm trying to compile and link a simple program to a DOS .com file using Turbo C compiler and linker. By that I try the simplest C-program I can think of. void main() {} Are there command line arguments to link to com files in the Turbo C Linker? The Error Message I get from the Linker is the following: "Fatal: Cannot generate COM file: invalid entry point address" I know that com files need entry point to be at 100h. Does Turbo C have an option to set this address? 回答1: It has been a long

Compile and Link to .com file with Turbo C

倾然丶 夕夏残阳落幕 提交于 2021-01-27 06:31:37
问题 I'm trying to compile and link a simple program to a DOS .com file using Turbo C compiler and linker. By that I try the simplest C-program I can think of. void main() {} Are there command line arguments to link to com files in the Turbo C Linker? The Error Message I get from the Linker is the following: "Fatal: Cannot generate COM file: invalid entry point address" I know that com files need entry point to be at 100h. Does Turbo C have an option to set this address? 回答1: It has been a long

clang++ 3.2 linker not finding C++ stdlib

做~自己de王妃 提交于 2021-01-27 03:54:01
问题 I've installed clang 3.2 on my Ubuntu 13.04 machine, and have compiled and built libc++, and everything is in place. However, when I try to link my (really simple) code, the linker reports that references to std::cout etc. are undefined. If anyone could advise me what I could do to solve this, I'd be very grateful -- I've tried everything I can think of. The commands and output are here: $ clang++ -v -stdlib=libc++ -lpthread -ldl sqlite3/sqlite3.o src/world.o -o bin/world Ubuntu clang version