linker

How to link custom C (which itself needs special linking options to compile) with Cython?

我的梦境 提交于 2019-12-22 17:58:37
问题 so I'm trying to create a Cython module which uses a .c file that I've written. That .c file needs a special linking option (to compile it, I need gcc -o mycode mycode.c -lfftw3f ). I could potentially just rewrite my .c file in Cython, but I want to know how to do this. I am using fftw3, and when compiling, you need to use the -lfftw3f option IN ADDITION to #include <fftw3.h> in the .c file if you want to use the float version, which I do. My setup.py looks like the following: from distutils

Swift linker error in release build fixable by adding code

穿精又带淫゛_ 提交于 2019-12-22 17:39:15
问题 In Xcode 8, a Swift project of mine works in Debug mode but fails to link in Release mode: Undefined symbols for architecture x86_64: "Swift.UnsafeMutableBufferPointer.(subscript.materializeForSet : (Swift.Int) -> A).(closure #1)" I can fix the error by changing this line: let nextPeriod = currentSchedule.periods.filter({ $0.startDate > now }).sorted(by: { $0.startDate < $1.startDate }).first to: let nextPeriod = currentSchedule.periods.filter({ $0.startDate > now }).first but that obviously

Keep gcc linker from using non-system libraries found in system /lib64 folder

帅比萌擦擦* 提交于 2019-12-22 12:31:01
问题 I am porting a large C++ library (libcoro.so) and example application (coro-example.cpp) from Windows to RedHat Linux 7.4. I have very little development experience on Linux, so this is probably a 'newbie' question. I have libcoro and the example app compiling, linking, and running on my RHEL 7.4 VM. However, the gcc linker fails to link the app on the customer's RHEL 7.4 machine when he tries to link coro-example.o to libcoro.so. The error message is: /usr/bin/ld: warning: libusb-0.1.so.4,

automake and custom rpath

非 Y 不嫁゛ 提交于 2019-12-22 12:17:36
问题 I have to ship a third-party library with an application. Because I don't want to set LD_LIBRARY_PATH by hand or require any wrapper script I want automake to set a custom rpath . Unfortunately libtool has its own -rpath option and adding -Wl,-rpath,/foo/bar to LDFLAGS only results in g++: unrecognized option '-rpath' because libtool seems to get confused with the command line options. The same happens with the alternative form -Wl,-rpath -Wl,/foo/bar . Is there any way to specify a custom

Visual Studio 2010 C++ linker performance for large projects

纵然是瞬间 提交于 2019-12-22 11:39:48
问题 At my company we're still using Visual Studio 2005, but are peeking at Visual Studio 2010 in the hope that it will speed up some parts of our development cycle. At the moment we're most interested in the performance of the C++ linker of Visual Studio 2010. When building our application, we're looking at link times between 40 seconds and 2 minutes, depending on machine configuration (SSD vs HDD) and if stuff is already in Windows' disk cache. A simple test where we use the VS2010 linker

LLVM Error : External function could not be resolved

混江龙づ霸主 提交于 2019-12-22 11:20:44
问题 I am reading the LLVM's Kaleidoscope tutorial (http://llvm.org/docs/tutorial/index.html). I wanted to compile and test the language. After some compiler's errors (EngineBuilder and Module's constructor, linking libs...), the example program was built. Then, I tried the language. I got a few problems with InitializeNativeTargets, DataLayoutPass... But I managed to correct them. Howewer, I don't manage to resolve one error. When I write extern printd(x); printd(5); , the program doesn't work :

C/C++ linker order for multiple defined symbols

不想你离开。 提交于 2019-12-22 11:01:17
问题 If I have the same symbol defined in an object file and in a library the GNU linker takes the symbol from the object file. Consider this example: g++ -L"dir/to/lib" -o Executable Test.o foo.o -lMyLib If I have defined a function foo with the same signature in both foo.cpp and in a source file "MyLib" was compiled from, the GNU linker always prefers the one from the former if I use this order. Is this behaviour GNU toolchain specific? Do you know from other linkers that behave the same way? Is

Weird xCode linker error I've never seen before saying “Assertion failed”

感情迁移 提交于 2019-12-22 10:45:22
问题 Built this game through Unity, and managed to compile through xCode once before. Without any apparent changes, however, this error message turns up. I don't understand where to start looking for a fix, but maybe someone else have a clue? I've seen similar looking errors through searches, though the fixes seem arbitrary compared to mine. Anyone able to shed some light? Thank you!! 0 0x1034de0e7 __assert_rtn + 144 1 0x10351350c archive::File<arm>::makeObjectFileForMember(archive::File<arm>:

Linking error with Poco Net

偶尔善良 提交于 2019-12-22 10:43:41
问题 I am stuck trying to get some code to build using the POCO libraries. I get the following when I try to build Undefined symbols for architecture x86_64: "Poco::Net::SocketAddress::SocketAddress(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned short)", referenced from: ..... ld: symbol(s) not found for architecture x86_64 Now here is the catch: I am linking with -lPocoFoundation -lPocoNet -lPocoUtil What am I missing? (I should say that I

gcc Linkage option -L: Alternative ways how to specify the path to the dynamic library

谁说我不能喝 提交于 2019-12-22 10:20:42
问题 If I compile my source code with "-L." the dynamic library libmd5.so can be found. gcc main.c -g -O2 -Wall -o main -L. -lmd5 -lcr But if I leave the "-L."-option away, the linker does not find the dynamic library. How can I change that without having to invoke "-L."? (additional info libmd5.so and libmd5.so.1.0.1 are located in /home/user/ba) 回答1: There's really nothing wrong with the -L flag, so you shouldn't try so hard to get rid of it - is it at runtime you have problems, as the system