static-libraries

Library for unrestricted heap memory for bitmaps using NDK on Android [closed]

可紊 提交于 2019-12-06 03:10:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . By design, Android apps are very limited in the amount of heap memory they can use. The limitation for SDK apps is as little as 16MB on old devices. This design choice usually makes sense because the OS tries to support multi-tasking on devices which are usually very low on memory - so each task gets its own

Static library and internationalization

别说谁变了你拦得住时间么 提交于 2019-12-06 02:59:48
I have a question regarding static libraries. I need to localize some text inside my library. So I created a bundle where I put my different localized files. Then, I created a function like this : NSString *MyLocalizedString(NSString* key, NSString* comment) { static NSBundle* bundle = nil; if (!bundle) { NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"MyStaticLib.bundle"]; bundle = [[NSBundle bundleWithPath:path] retain]; } return [bundle localizedStringForKey:key value:@"" table:nil]; } But when I use it, it always return the english localized string

dlopen a dynamic library from a static library, when the dynamic library uses symbols of the static one

瘦欲@ 提交于 2019-12-06 02:38:10
问题 This question is closely related to dlopen a dynamic library from a static library linux C++, but contains a further complication (and uses C++ instead of C): I have an application that links against a static library (.a) and that library uses the dlopen function to load dynamic libraries (.so). In addition, the dynamic libraries call functions defined in the static one. Is there a way to compile this without linking the dynamic libraries against the static one or vice versa? Here comes what

Python - Py_Initialize unresolved during compilation

前提是你 提交于 2019-12-06 02:32:53
问题 I have statically compiled Python2.7 without any error. To test my build, I use the following snippet: #include "Python.h" int main() { Py_Initialize(); } And I am compiling it like this: $ gcc -static -I/path/to/python/header -L/path/to/my/staticpythonlib \ -lpython2.7 -ldl -l_all_other_needed_lib /tmp/my_previous_snippet.c -o myouput However, an error occured. gcc claims the famous undefined reference . test.c:(.text+0x1): Undefined reference to 'Py_Initialize' Curiously I used gcc with the

Obtaining older SDKROOT behavior in XCode

百般思念 提交于 2019-12-06 02:14:48
I'm trying to setup a library for simulator or device building and everywhere I see explains that SDKROOT should expand to a /Developer/Platform/<>/SDKs/<>/, where <> is filled in by your project settings. Many links on the internet explain that SDKROOT will expand to a path, but the newer versions of XCode, SDKROOT expands to "iphoneos2.2.1" - which isn't nearly as helpful (for this task). Clearly enough if you look at apples documentation, the behavior changed: http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Reference/XcodeBuildSettingRef/9-Revision-3.1/history.html I

Export an `OBJC_CLASS` from one static lib as part of another

余生长醉 提交于 2019-12-06 01:30:42
I want to create a static library (actually, a framework, but I know how to do that part) that bundles up code from, among other things, another static library. However, the OBJC_CLASS exports from the original library end up as undefined symbols. For example, in Xcode 5.1.1 (using default settings/choices at every step, unless otherwise specified): Create a new "iOS Framework & Library Cocoa Touch Static Library" project named LibA. Build (for either simulator or a real device, doesn't matter). Create another new "iOS Framework & Library Cocoa Touch Static Library" project named LibB. Drag

Autoloading functions best practices

可紊 提交于 2019-12-06 01:22:43
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 question regarding a parameter/reference issue with option 1 , which can be found here: __callStatic(),

Symbol not found when static linking on MacOSX

隐身守侯 提交于 2019-12-06 01:11:26
I am trying to create a static library and link it on MacOS X (several versions): File foo.c : char foo[111]; File bar.c : #include <string.h> extern char foo[]; int bar(char *src) { strcpy(foo, src); return strlen(foo); } Create a library: $ cc -c foo.c bar.c $ ar r libfoobar.a foo.o bar.o ar: creating archive libfoobar.a $ ranlib libfoobar.a $ nm libfoobar.a libfoobar.a(foo.o): 000000000000006f C _foo libfoobar.a(bar.o): U ___strcpy_chk 0000000000000000 T _bar U _foo U _strlen Create a small test program: File main.c : #include <stdio.h> int bar(char *); int main(void) { printf("foobarbar =

static library has big size

喜欢而已 提交于 2019-12-06 00:07:15
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. 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%. in terminal run strip -x [youStaticlib.a] Description For dynamic shared libraries, the maximum level of stripping is usually -x (to

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

ⅰ亾dé卋堺 提交于 2019-12-05 21:49:48
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 libraries behave in the context of DLLs.) Now my question.. We want to change utilities.lib so that it becomes