ld

linker error while linking boost log tutorial (undefined references)

南笙酒味 提交于 2019-12-27 23:39:24
问题 I have installed boost on Fedora 20 via yum and am trying some simple examples. However I have trouble to compile the first example from the logging tutorial. Compiling with g++ -c boosttest.cc works fine, but I get lot's of errors when I try to link it with g++ boosttest.o -o boosttest -lboost_log -lpthread the full error-log: boosttest.o: In function `main': boosttest.cc:(.text+0x44): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()' boosttest.cc:(.text+0x9a):

Include binary file with GNU ld linker script

狂风中的少年 提交于 2019-12-27 22:13:00
问题 I have a working linker script. I want to add another data section whose contents is pulled directly from a file (ld shouldn't parse it and extract the sections and so on). How can I do that? OUTPUT_FORMAT("elf32-i386") ENTRY(start) SECTIONS { .text 0x100000 : { *(.multiboot) *(.text) *(.code) *(.rodata*) } .data : { *(.data) } .bss : { *(.bss) } kernel_end = .; roottask_start = .; .data : { HERE I WANT TO INCLUDE THE ENTIRE CONTENTS OF ANOTHER (BINARY) FILE } roottask_end = .; } 回答1: You

Error “library not found for -lPods-MyProjectTests-KIF” when installing KIF in existing workspace

时间秒杀一切 提交于 2019-12-25 08:52:47
问题 I run into this error when adding KIF to an existing Xcode 6 workspace: ld: library not found for -lPods-MyProjectTests-KIF What may be special about my situation that MyProject.xcworkspace/ resides in the parent directory of MyProject.xcproject/ (and depends on several other sibling projects as well): ./MyProject.xcworkspace/ ./MyProject/ ./MyProject/MyProject.xcworkspace/ ./MyProject/Podfile My Podfile is as follows: target 'MyProjectTests', :exclusive => true do pod 'KIF', '~> 3.0',

linker could not found object files from different directory with scons

*爱你&永不变心* 提交于 2019-12-25 03:12:16
问题 Currently, I make a project with scons. I compiled source codes and it is time to link them. However, I got an error that ld cannot find object files. The SConscript is located in src/kernel32, and import os, sys # Compile CPP env_gpp_options = { 'CXX' : 'x86_64-pc-linux-g++', 'CXXFLAGS' : '-std=c++11 -g -m32 -ffreestanding -fno-exceptions -fno-rtti', 'LINK' : 'x86_64-pc-linux-ld', 'LINKFLAGS' : '-melf_i386 -T scripts/elf_i386.x -nostdlib -e main -Ttext 0x10200', } env_gpp = Environment(**env

relocation truncated to fit r_386_8 against .bss'

。_饼干妹妹 提交于 2019-12-24 21:42:27
问题 When i type ld -m elf_i386 -o loop loop.asm, i get the error stated in the title, any idea what causes it? Sorry if the code looks bad, fairly new to assembly. cr equ 13 lf equ 10 section .bss numA resb 1 section .text global _start: mov [numA],byte 0 call loop1 jmp endend loop1: xor cx,cx mov al, $numA cmp cx, 0x0A jle else inc al jmp end else: dec al jmp end end: mov [$numA], al inc cx cmp cx,20 jle loop1 endend: mov dl,$numA mov ah,2 int 21h 回答1: In NASM, $numA is the same as numA . A

Use variable across multiple Cpp files

﹥>﹥吖頭↗ 提交于 2019-12-24 18:12:58
问题 Have searched enough answers but none of the solutions work for me. scenario : I am trying to include a .h file that has some functions declared (not defined) and some variables declared. If I include this header file in the source files (2 to be precise) that actually use the functions and variables, then the last one that compiles has a linker error that states undefined reference to `abc::myfun(char const*, char const*, char*)' All the functions and variables in the header files have been

make file compile error undefined symbol `strtoflt128' error

99封情书 提交于 2019-12-24 15:18:01
问题 I was compiling a make file on my PC. When I ran it, it generates the following error: R_X86_64_PC32 against undefined symbol `strtoflt128'. My PC is Windows 8.1 64 bit. I have cygwin64 installed with the following packages; gcc-core4.9.3, gcc-g++ 4.9.3, gcc-fortran 4.9.2-3. 回答1: This symbol is provided by libquadmath, so you will need to add -lquadmath to your link command. If it is already there, make sure it comes after all object files and static libraries. 来源: https://stackoverflow.com

CMake Build Mac App

烂漫一生 提交于 2019-12-24 14:38:51
问题 Our company uses CMake currently to build our executables for Windows. I'm working on making our application work on Mac. So far the application builds fine on the Mac. However, when I try to open the Executable that CMake creates for the Mac, I get the following error in a terminal window: Last login: Tue Apr 16 14:34:58 on ttys001 Locals-MacBook-Pro:~ auser$ /Users/auser/Documents/Projects/CodeMonkey/bin/CmDeveloperKit ; exit; dyld: Library not loaded: libAbcSupport.dylib Referenced from:

Creating shared object from static library whose object files were linked with -fPIC

删除回忆录丶 提交于 2019-12-24 14:30:18
问题 For a project we are trying to create a shared object file that exports a set of functions specified in libname.exports . Of course we know that the object files from which the .so file gets linked have to be created using -fPIC , so that has been taken care of. We then combined the object files into an archive named libname.a . This should now be the basis for the .so file to be created - or so was the idea. We're passing libname.exports to --retain-symbols-file , so the expected behavior

Run g++ linking to special libraries

萝らか妹 提交于 2019-12-24 07:05:27
问题 These ideas may seems strange... I've made other environment on my Gnu/Linux system by creating directory and copy there necessary files to bin, lib, usr, etc and others. Then I do 'chroot' and then do some operations inside. The problem is that all files in environment were taken from older OS (2.4 kernel version). But compiler must be taken modern (with support of modern language standarts). When I'm trying to run compiler inside the environment it goes with errors: g++: /lib/libc.so.6: