ld

Hide symbol(s) in Shared Object from LD

99封情书 提交于 2020-01-01 05:05:29
问题 I have two third-party libraries occasionally having the same symbol name exported. When the executable is loaded, ld usually picks the wrong one and I getting crash as a result. I cannot do too much about the content of these libraries, so may be there is a way to instruct ld how to find the proper imlementation ? OS - Solaris 10, my program is built by autoconf/autotools/gcc, conflicting libraries are libclntsh (part of Oracle driver) and OpenLDAP. Unfortuinately, I cannot use Oracle's

MinGW/Eclipse ld.exe does not find libraries

妖精的绣舞 提交于 2020-01-01 04:37:30
问题 I am using Eclipse CDT to try to compile a project with the Ogre 3D engine. But somehow mingw is not able to find the static libraries I link against. These are the error messages: c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lzziplib_d c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lzlib_d c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lfreetype_d ...etc. The list goes on like this

Linker performance related to swap space?

家住魔仙堡 提交于 2019-12-31 10:10:08
问题 Sometimes it's handy to mock up something with a little C program that uses a big chunk of static memory. I noticed after changing to Fedora 15 the program took a long time to compile. We're talking 30s vs. 0.1s. Even more weird was that ld (the linker) was maxing out the CPU and slowly started eating all available memory. After some fiddling I managed to find a correlation between this new problem and the size of my swap file. Here's an example program for the purposes of this discussion:

What's the proper way to link against an executable on Windows?

自闭症网瘾萝莉.ら 提交于 2019-12-31 03:20:08
问题 I need to use some symbols from the main executable in a plugin. Linking against the executable causes the following linker errors: i686-w64-mingw32-g++ example.cpp -shared -I.. -std=c++11 -o test.dll ../../test.exe -static-libgcc -static-libstdc++ -fvisibility=hidden [..]/test.exe:cygming-crtbegin.c:(.text+0x500): multiple definition of `__gcc_register_frame' /usr/lib/gcc/i686-w64-mingw32/5.1.0/crtbegin.o:cygming-crtbegin.c:(.text+0x0): first defined here [..]/test.exe:cygming-crtbegin.c:(

Cant use shared libraries in Qt project

南笙酒味 提交于 2019-12-30 22:45:07
问题 I created a C++ library project in Qt creator. After building the project I have the libMylib.so, .so.1, .so.1.0, .so.1.0.0, Makefile and mylib.o files. I added the library headers to my other project and added the path to my .pro file like this: LIBS += "/home/peter/Workspace/build-Libtester-Desktop-Release/libMyLib.so" When building the application I don't get no such file error, but when running it I get this: /home/peter/Workspace/build-Libtester-Desktop-Debug/Libtester: error while

Compiling C Library for iOS 9 From Command Line, Xcode 7-beta 2

こ雲淡風輕ζ 提交于 2019-12-30 07:31:43
问题 I am having trouble compiling a C library (gmp) for iOS 9 using the latest Xcode 7-beta clang. I am trying to produce bitcode to get all the warnings in Xcode to stop (and I would like to produce these libraries in bitcode). However, I can't even compile the library in the first place. ./configure fails, and after looking at the config.log, it seems ld is the problem as it is failing with "ld: library not found for -lSystem". Here is the command I have used to compile gmp in the past : .

Why do STM32 gcc linker scripts automatically discard all input sections from these standard libraries: libc.a, libm.a, libgcc.a?

ⅰ亾dé卋堺 提交于 2019-12-30 06:50:13
问题 From the bottom of any auto-generated STM32CubeMx-generated linker script: /* Remove information from the standard libraries */ /DISCARD/ : { libc.a ( * ) libm.a ( * ) libgcc.a ( * ) } From the GNU Binutils ld (linker script) manual, 3.6.7 Output Section Discarding: The special output section name ‘/DISCARD/’ may be used to discard input sections. Any input sections which are assigned to an output section named ‘/DISCARD/’ are not included in the output file. What do these 3 input object

ld: library not found

别来无恙 提交于 2019-12-30 06:38:37
问题 I'm trying to build a project that depends on SDL2 library. I've installed and linked it using homebrew: > ls /usr/local/lib | grep SDL2 libSDL2-2.0.0.dylib libSDL2.a libSDL2.dylib libSDL2_test.a libSDL2main.a I also added /usr/local/lib to my /etc/paths and ~/.bash_profile as well: > cat /etc/paths /usr/local/lib /usr/local/bin /usr/bin /bin /usr/sbin /sbin However, when I try to build the project, I still get this error: error: linking with `cc` failed: exit code: 1 note: cc '-m64' '-L' (..

Cannot find crtn.o, linking 32 bit code on 64 bit system

◇◆丶佛笑我妖孽 提交于 2019-12-29 06:19:52
问题 I'm attempting to assemble some 32-bit code using NASM and GCC on a 64-bit system. I use the following two commands nasm -f elf32 -g -F stabs coc.asm gcc -m32 -o coc coc.o NASM appears to do fine, but LD complains: /usr/bin/ld: cannot find crt1.o: No such file or directory /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping

Very strange linker behavior

会有一股神秘感。 提交于 2019-12-28 08:04:56
问题 This is strange because I was able to get the error below to go away by removing the reference to libm. gcc -o example example.o -Wl -L/home/kensey/cdev/lib -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -L/usr/lib/x86_64-linux-gnu -lm -lrt -ldl -lcdev -L/home/kensey/www.tools/gplot-lib -lgplot -L/home/kensey/www.tools/gd1_3ret -lgd -lxml2 -lcurl /usr/bin/ld: /home/kensey/www.tools/gplot-lib/libgplot.a(set.o): undefined reference to symbol 'floor@@GLIBC_2.2.5' /usr/bin/ld: note: