static-libraries

Linking static library into R

不打扰是莪最后的温柔 提交于 2019-12-08 02:59:49
问题 I have a static library which I am trying to use inside my R package. This is only for internal use. The libq.a for now is just within ./src folder. I was trying to add the following to src/Makevars: PKG_LIBS="-l/path/to/lib/libq.a" Where /path/to/lib is an absolute path to the libq.a location (for testing purposes only). But that doesn't seem to help. Do I have to do anything else in order to load that static library? 回答1: That should work -- make sure you see the library used on the final

Automake Combine two static libraries into one

妖精的绣舞 提交于 2019-12-07 21:09:48
问题 I am trying to include symbols from a pre-built static library into a static library that I am building. The static library that I am building is then used inside of an executable. The problem I am having is that I am getting undefined symbols in my static library from the other static library. Which means the symbols I need from the pre-built static library are not being included in my static library. What is the correct approach with auto tools to do this? I know I need to un-archive the

Extraneous Library Linkage

对着背影说爱祢 提交于 2019-12-07 18:05:04
问题 I have a question which may be somewhat silly because I'm pretty sure I may know the answer already. Suppose you have static library A, and dynamic shared object library B and your program C under linux. Suppose that library A calls functions from library B and your program calls functions from library A. Now suppose that all functions that C calls in A make no use of functions in B. To compile C will it be enough to link just A and omit B and furthermore can your program C be run on a system

How to mimic the “multiple instances of global variables within the application” behaviour of a static library but using a DLL?

喜你入骨 提交于 2019-12-07 17:47:14
问题 We have an application written in C/C++ which is broken into a single EXE and multiple DLLs. Each of these DLLs makes use of the same static library ( utilities.lib ). Any global variable in the utility static library will actually have multiple instances at runtime within the application. There will be one copy of the global variable per module (ie DLL or EXE) that utilities.lib has been linked into. (This is all known and good, but it's worth going over some background on how static

Conflict between static libraries used in Xcode project

对着背影说爱祢 提交于 2019-12-07 16:47:23
问题 I am using RestKit, GData and Facebook API. All of them has a JSON files, many of them share the same name, enums etc. When i compile I get an error on duplicates. How can i prevent the conflicts? Thanks Shani 回答1: This is my best guess. It would be helpful to post the errors you get on compile. If you are using the -all_load linker flag, turn it off. If your libraries require that you use this option, try using -force_load option on the specific libraries that require it. As an absolute last

Export Symbols of Static Library When Used for iOS App Creation

雨燕双飞 提交于 2019-12-07 16:23:18
问题 Some code packed up in a static library by me (using libtool ) should be used in another project to build an iOS application. To make crash analysation possible, the .dSYM of the app should also contain the symbols of my static library. I assume I have to somehow either include the symbols in the library proberly or have to pass some symbols file to the build step that creates the .dSYM. Is this possible? I am a bit overwhelmed by all the steps involved in the process of creating the .dSYM.

static library has big size

早过忘川 提交于 2019-12-07 14:47:57
问题 I built universal static library with help of this template The problem that is my library libWrapper.a has size 1.3 mb??? :0 while my source code has 130 kb. How I can reduce the size of my static lib? Other strange thing - Each lib has the same size - 1.3 mb. I supposed that universal (fat) libs should have bigger size. 回答1: Also make sure that you set Generate Debug Symbols to NO in your build settings. This can reduce the size of your static library by about 30%. 回答2: in terminal run

Autoloading functions best practices

蓝咒 提交于 2019-12-07 14:42:20
问题 When working on a PHP project that takes advantage of the OOP paradigm with PHP's __autoload() function, which of the following is considered the best practice for managing stand-alone functions: ( Examples provided are simplified for the sake of brevity ) tl;dr : How is stand-alone function loading commonly handled: pseudo-autoloading (via __callStatic magic for example) [ Option 1 ] abstract helper class grouped static methods [ Option 2 ] an alternative Also note, I've posted a related

gcc static library linking vs dynamic linking

流过昼夜 提交于 2019-12-07 12:24:49
问题 My build environment is CentOS 5 . I have a third party library called libcunit. I installed it with autotools and it generates both libcunit.a and libcunit.so . I have my own application that links with a bunch of shared libraries. libcunit.a is in the current directory and libcunit.so and other shared libraries are in /usr/local/lib/ . When I compile like: gcc -o test test.c -L. libcunit.a -L/usr/local/lib -labc -lyz I get a linkage error: libcunit.a(Util.o): In function `CU_trim_left':

How I do compile a application against a static library compiled with libc++ in xcode/clang/macos?

不想你离开。 提交于 2019-12-07 11:19:48
问题 When I try to compile a test console application to test some functionality on a static library on the same workspace, i run into problems in the linking stage of the binary, it only happen when I choose to use libc++ standard library. The missing symbols error is the follow : Undefined symbols for architecture x86_64: "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::empty() const", referenced from: libtorrent::torrent::replace_trackers(std::__1::vector