linker

Building Gold linker in FreeBSD

坚强是说给别人听的谎言 提交于 2020-01-06 19:06:17
问题 I followed the steps on http://llvm.org/docs/GoldPlugin.html#lto-how-to-build to build the gold plugin on FreeBSD but ! Heres a link to the screenshot of the error:http://postimg.org/image/anlpuufbl/ This is the error message that it shows and so I am also unable to get ld-new. I checked and no CFLAGS were set in etc/make.conf. How to proceed with the installation? I am using the deault clang version supplied with FreeBSD 10.1. 回答1: I think you just need to install devel/binutils port or its

can static linking result in executing some init routines?

断了今生、忘了曾经 提交于 2020-01-06 14:58:14
问题 do not understand this thing: I got a program in c and I am linking some second party static libs to that (as far as I know lhis libs can be also some wrappers on dlls) - does it can bring my program to 'implicitely' (I mean without explicit call to that in my code) run some initialisation code from whithin those libs (that will execute before my main() routine ? - or it cannot ?) I am asking here about about c code (eventualy about c code without any c++ feature but compiled in c++ mode by c

Pruning a static library in c++

半城伤御伤魂 提交于 2020-01-06 08:33:14
问题 I am trying to expose a single well defined class by building a static library and then shipping the built library with a few header files that define that class and the interfaces needed to use it. I have that working but the problem I am running into is the library is gigantic. It has every single object file from the whole project and all I need is a subset. If I make a simple main.cpp file and include and use that single class then I get a output file that is only as big as the 20% of the

linking problem, can't find symbol even though nm shows symbol in library

杀马特。学长 韩版系。学妹 提交于 2020-01-06 08:10:53
问题 I'm linking an app against lflutter_linux_glfw . nm tools shows it has glad_glTexImage2D : nm libflutter_linux_glfw.so | grep glTexImage2D 00000000034e87a0 b glad_glTexImage2D 00000000034e87a8 b glad_glTexImage2DMultisample So I included lflutter_linux_glfw.so before flutter_video_renderer.o , and I get this: clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64

crti.o file missing

那年仲夏 提交于 2020-01-06 08:06:20
问题 I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o . This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o , wouldn't it use a library file, e.g. libc.a ? I'm cross compiling for the arm platform. I have the file in the toolchain, but how do I get the linker to include it? crti.o is on one of the 'libraries' search

compiling against a modified header file

时光总嘲笑我的痴心妄想 提交于 2020-01-06 07:42:31
问题 I have a header file with a class definition and some includes. The class contains some public functions and some private variables. The class gets compiled into an executable. Lets say that somebody takes this header file and creates a "public" copy. He removes all the includes and private variables (uses forward declarations for the undefined symbols). Then he compiles his own code (which calls the public functions of the class in question) against the "public" header file and creates an

Embedding Python 3.3

假装没事ソ 提交于 2020-01-06 07:34:30
问题 I try to embed Python 3.3, as described here. I'm on MacOS 10.8 which has Python 2.7 so I downloaded binary distribution of version 3.3 from python.org. From it I got all the headers and "Python" which I renamed to "python33" so it wont collide with installed "Python" lib. I put everything into a folder: embed.c /include python33 "file python33" says: python33 (for architecture i386): Mach-O dynamically linked shared library i386 python33 (for architecture x86_64): Mach-O 64-bit dynamically

Using Cspice with mingw

梦想的初衷 提交于 2020-01-06 07:21:09
问题 I am trying to use cspice with g++ for windows via mingw. Unfortunately cspice does not provide a library for mingw. The libraries are available at https://naif.jpl.nasa.gov/naif/toolkit_C.html. It gives undefined reference errors for the functions defined through cspice. It runs properly in Linux. Can anyone suggest a method to make it work. I run: g++ -LK:\Data\cspice\lib -IF:\CPP\Libraries\Boost\boost_1_68_0 -o foo foo.cpp -l:cspice.a -lm The errors I get are: undefined reference to

How to link a dynamic Rust library using only rustc and not cargo?

廉价感情. 提交于 2020-01-06 06:12:31
问题 My main.rs looks like // #[link(name = "lib")] extern "C" { fn hello(); } fn main() { unsafe { hello(); } } And lib.rs : #[no_mangle] pub fn hello() { println!("Hello, World!"); } I have compiled lib.rs using rustc --crate-type=cdylib lib.rs -o lib.so How do I link lib.so to rustc main.rs command ? 回答1: You need to match ABIs. When you use an extern "C" block, you need to declare your functions using the same ABI. Name your dynamic library using the platform's conventions. Use .dylib on macOS

How to link a dynamic Rust library using only rustc and not cargo?

孤者浪人 提交于 2020-01-06 06:11:48
问题 My main.rs looks like // #[link(name = "lib")] extern "C" { fn hello(); } fn main() { unsafe { hello(); } } And lib.rs : #[no_mangle] pub fn hello() { println!("Hello, World!"); } I have compiled lib.rs using rustc --crate-type=cdylib lib.rs -o lib.so How do I link lib.so to rustc main.rs command ? 回答1: You need to match ABIs. When you use an extern "C" block, you need to declare your functions using the same ABI. Name your dynamic library using the platform's conventions. Use .dylib on macOS