static-libraries

CLion and CMake: only building a library without an executable?

橙三吉。 提交于 2019-11-30 06:38:28
问题 How to only build a static library with clion without having an executable? How does the CMakeLists.txt look like? (without add_executable ) Update: If I don't add executable to Clion, I have an error, that an executable is required. Here my CMakeLists.txt. 回答1: This is an old question. But I'll add the answer to your question as a help for other people. You need to replace your add_executable with add_library add_library(target_name source_files) 来源: https://stackoverflow.com/questions

Building a distributable static library that uses cocoapods

Deadly 提交于 2019-11-30 06:31:12
问题 I'm building a static library to be distributed to other iOS developers and having some trouble configuring the linker to allow the static library to be used in another app. I have used this guide to create a MyStaticLibrary.framework bundle containing the lib itself, and other assets such as images. This builds successfully and uses cocoapods to source the required dependencies (AFNetworking, etc.). So far, so good. But when I import MyStaticLibrary.framework into a new Xcode project to test

Android Studio + Volley [duplicate]

[亡魂溺海] 提交于 2019-11-30 06:26:22
问题 This question already has answers here : Volley Android Networking Library (19 answers) Closed 5 years ago . I'm new to Android Studio and I want to use Volley library for my app but i can't add the source as a library in Android Studio. I've searched the web but couldn't find anything. Everywhere is said to import as a library but I don't know how. I got the volley source from git repository: https://android.googlesource.com/platform/frameworks/volley But I don't know how to add it to my

Static library & Dynamic library : Confusion

依然范特西╮ 提交于 2019-11-30 05:23:18
I need little clarification in this area. I feel that the terms Static library & Dynamic Library are not correct. lib1.o + lib2.o + lib3.o --> "LinkerOutputFile"(executable or library). If this "LinkerOutputFile" contains the code of all the files lib1.o , lib2.o, lib3.o then its said that "LinkerOutputFile" is satically-linked "LinkerOutputFile"(executable or library). (or) If "LinkerOutputFile" just contains references & other information about to lib1.o, lib2.o, lib3.o without containing the code of these lib*.o files. Then its said that "LinkerOutputFile" Dynamically linked. How does this

Mac OS X and static boost libs -> std::string fail

旧时模样 提交于 2019-11-30 04:42:38
问题 I'm experiencing some very weird problems with static boost libraries (Boost 1.45.0-2 from MacPorts, compiled as fat/universal (x86/x86_64) libraries) under Mac OS X 10.6.6 with GCC 4.5. The error message is main(78485) malloc: *** error for object 0x1000e0b20: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug [1] 78485 abort (core dumped) and a tiny bit of example code which will trigger this problem: #define BOOST_FILESYSTEM_VERSION 3 #include <boost

Is it possible to link a static library to Java through JNI?

↘锁芯ラ 提交于 2019-11-30 04:37:44
问题 Is it possible to build a HelloWorld.lib and load it to a Java application using JNI? Or it just works with shared libraries? I couldn't find a clear answer on the JNI documentation, there's no reference to "static library". 回答1: It needs to be a dynamic library. Fortunately, you can build a dynamic library from a static one. 回答2: Java 8 supports statically linked native libraries http://openjdk.java.net/jeps/178 回答3: To load a library at runtime it must be a dll (windows). If you have a

Linking Windows DLL files from static libraries using CMake without hand-crafting unresolved symbol names

▼魔方 西西 提交于 2019-11-30 04:34:33
The Situation I'm using Visual Studio 2008 SP1 (Professional Edition, both for 32-bit and 64-bit builds). I'm seeking a workaround to what I believe is a very unhelpful " limitation " in Visual Studio. I find it quite surprising that the Visual Studio linker and compiler does not do this right at DLL file creation time, to automatically scan all specified static libraries for all exported symbols in the same manner given in Building an Import Library and Export File and in a StackOverflow comment . I confirmed that it is not sufficient to simply apply __declspec(dllexport) and __declspec

Interface Builder can't see classes in a static library

霸气de小男生 提交于 2019-11-30 03:44:59
I have refactored some UIView sub-classes into a static library. However, when using Interface Builder to create view components for a project that uses the static library I find that it is unaware of the library classes. What do I need to do to make the class interfaces visible to Interface Builder? Update: The correct answer refers to dragging the headers into the 'XIB browser'. The '.h' files can be dragged from a finder window to the window area identified in this image: alt text http://img211.imageshack.us/img211/1221/xibbrowser.png Try dragging the static library into your xib browser in

Throwing C++ exceptions outside static library?

。_饼干妹妹 提交于 2019-11-30 03:12:37
问题 As a rule, exceptions must not propagate module boundaries as for example explained in Herb Sutters C++ Coding Standards (item 62). When compiled with different compilers or just compiler settings this might crash. I can understand the issue in case e.g. of dynamic link libraries. But I wonder whether it also holds for static libraries. Is a static library a module in the sense of the above rule? If the library is compiled with other compiler settings (e.g. alignment) might the program crash,

Loading time for shared libraries vs static libraries

一世执手 提交于 2019-11-30 02:28:11
I have a question on shared libraries vs static libraries loading time. Assume that i have a executable foo.exe which uses liba, libb, libc. Also at a given time there are more than 10 instances of the executable running on the machine. Now if the above 3 libraries were shared libraries : 1st Insance is loaded into RAM : The time taken will be time taken by main() of foo.exe to be loaded memory (assuming its negligible) + time to load liba + time to load libb + time to load libc 2nd instance is started : Now assume a second instance of this executable is run. Since all libraries are already