static-libraries

How to fix “is a dynamic library, not added to the static library” warning?

眉间皱痕 提交于 2019-12-05 04:54:30
I just upgraded to Xcode 5.1, and all of a sudden there is a new warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library The target which generates this warning is the cocos2d-iphone v2 static library (rather than use cocos2d templates, I create a static library). To create the static library all I did was add the cocos2d project to my workspace, have my project link

Static members of static libraries

一个人想着一个人 提交于 2019-12-05 02:00:06
问题 I have static library with static member. This library statically linked to main application and to one of its plugins. Looks like static variable initializing both in main (application) and in dll (plugin). Question : How to avoid static variable reinitialization when dynamic library loading. Or may be I missing something simple? More information: This is simple static library, that contains static member and it's getter and setter: orbhelper.h class ORBHelper { static std::string sss_;

Compile a static library link with standard library (static)

≡放荡痞女 提交于 2019-12-05 01:37:04
问题 I'm trying to compile a static library (let's call it library.a). This library consumes resources of standard libraries. There is some way that the library can statically link a standard library. I have proven something like: g++ -c library -static-libstdc++ -o library.o ar rcs library.o library.a But if I do so there is no link to the standard libraries. Then I have proved this way: g++ library -static-stdlib -o library.o ar rcs library.o library.a But ask me to add a main function. Is there

Create iOS static library from robovm project (BAD_ACCESS in JNI)

喜欢而已 提交于 2019-12-05 01:15:55
问题 I have a large amount of Java code (only calculation functions, no UI) that I want to reuse as a static library in iOS. My approach was to use robovm and follow the unofficial way to create a static library described in the two articles in the robovm forum: 1 Basic way and 2 Refined version Trying to follow the steps exactly as described I got stuck unfortunately after creating the shared library with the script, linking the library (.a) in Xcode and building the project successfully. During

Linker Trouble: How to determine where a “/DEFAULTLIB” is coming from

做~自己de王妃 提交于 2019-12-05 00:56:10
I am trying to find a good way to determine what module at link time is causing a certain library to get processed as a "/DEFAULTLIB" as seen in the verbose linker output from Visual Studio. Here is my situation, I have several static library pre-requisites and each has a release and a debug version (BlahD.lib and Blah.lib). For some reason at link time all of the *D.lib's are processed as default libraries even though I am building a release with the non-debug libs specified as "Additional Dependencies". If I never build the debug versions of the static libraries those *D files wouldn't exist

Link error: “Cannot find -ltinfo” on Ubuntu 12.04 on a 32-bit arm processor

人走茶凉 提交于 2019-12-05 00:51:59
I get the following link error when I'm compiling a small function using ncurses for an Ubuntu 12.04 running on arm. The error is arm-linux-gnueabihf/bin/ld: cannot find -ltinfo A lot of hints are floating around on what to install, but I can't seem to find any packages that does the trick for my arm box. I have done sudo apt-get install libncurses5-dev And this does not contain the tinfo library. Other suggestions usually result in the library is "not available but referred by another package" or "has no installation candidate". All help is appreciated /Henrik As mentioned by lucasg sudo apt

Calling functions in an so file from Go

淺唱寂寞╮ 提交于 2019-12-04 23:48:22
问题 Is it possible to call a static object (.so) file from Go? I've been searchign Google and I keep hitting upon the claim that I can do lib, _ := syscall.LoadLibrary("...") But trying this gives an error undefined: syscall.LoadLibrary and searching through Godocs I cannot find reference to this function in the syscall package. Is it possible to load a library and call its functions? 回答1: On a POSIX platform, you could use cgo to call dlopen and friends: // #cgo LDFLAGS: -ldl // #include <dlfcn

Create universal framework with static library

无人久伴 提交于 2019-12-04 23:14:16
I have created a framework which contains a static library inside: The frameworks works in device, but simulator is started giving errors. Then i try to make the universal framework using script given here: https://medium.com/@nishantnitb/writing-custom-universal-framework-in-xcode-9-and-ios-11-7a63a2ce024a Now i can able to see universal framework: But still not able to run in simulator, this framework is working in real device. It is giving error _OBJC_CLASS_$someclass", referenced from: in simulator. Should i need to make universal to static library as well?If yes how can i add in my

Force GCC to static-link e.g. pthreads (and not dynamic link)

青春壹個敷衍的年華 提交于 2019-12-04 22:32:37
问题 My program is built as a loader and many modules which are shared libraries. Now one of those libraries uses pthreads and it seems its bound to the module dynamically (loaded on startup). Now it'd be simplier if i could force pthreads to be linked into the module file. GCC on linux, how do i do? I guess a libpthread.a is necessary.... 回答1: While linking libpthread.a into a shared library is theoretically possible, it is a really bad idea . The reason is that libpthread is part of glibc , and

Libtorch/Pytorch Dilemma when combined static library into one STATIC library

房东的猫 提交于 2019-12-04 21:19:27
I have around 26 static libraries such as liba.a, libb.a, libc.a, ..., libz.a . There are two catches here: 1) circular dependencies between for example liba.a and libb.a ; 2) some lib*.a has static global registration code which is unreferenced, but shall NOT be stripped away. Thanks to stackoverflow, I managed to solve above two problems with the ld option -Wl,--whole-archive -la -lb -lc -ld -le ...(omitted)... -lz -Wl,--no-whole-archive -lpthread -lm -ldl -lrt -fopenmp , and the executable binary works! It is also explained in ld linker question: the --whole-archive option Now I need to