static-libraries

How to merge two windows vc static library into one

大憨熊 提交于 2019-11-26 14:52:48
问题 I am having a two static library a.lib and b.lib (of C language) which is generated using VC6 (Visual studio 6.0) . I want to merge these two libs into one static lib c.lib . How to do this in CLI mode? I have seen the merging of *nix static libs. I want to do the samething with VC6 static libs in CLI mode. 回答1: LIB.EXE /OUT:c.lib a.lib b.lib LIB.EXE is available in < VC6_InstalledFolder >/VC98/BIN. And this LIB.EXE is available in all versions of visual studio. 来源: https://stackoverflow.com

Categories in static library for iPhone device 3.0

◇◆丶佛笑我妖孽 提交于 2019-11-26 14:17:17
问题 I have categories in my static library. Any application developer should set -ObjC flag to "Other Linker Flags" to use my static library properly. It works fine for iPhone device/iPhone Simulator 2.x and iPhone Simulator 3.0. But it crashes for iPhone device 3.0. As written in this article it is new linker bug. They suggest to use one more linker flag: -all_load. But when I add this flag, build fails too, because there are duplicate symbols. How to use categories in static libraries for

Convert a Static Library to a Shared Library (create libsome.so from libsome.a): where&#39;s my symbols?

不羁岁月 提交于 2019-11-26 14:05:56
问题 the title of this question is an exact dupe, but the answers in that question don't help me. I have a bunch of object files packed in a static library: % g++ -std=c++98 -fpic -g -O1 -c -o foo.o foo.cpp % g++ -std=c++98 -fpic -g -O1 -c -o bar.o bar.cpp % ar -rc libsome.a foo.o bar.o I'd like to generate libsome.so from libsome.a instead of the object files, but the library is really barebones: % g++ -std=c++98 -fpic -g -O1 -shared -o libsome.so libsome.a % nm -DC libsome.so 0000xxxx A _DYNAMIC

Xcode — get force_load to work with relative paths

我们两清 提交于 2019-11-26 13:55:54
问题 Some libraries require the -all_load linker flag when linking to an Xcode project. However, this leads to a linker error if there are symbol conflicts among libraries. The solution is to use -force_load, which effectively lets you use -all_load on some libraries, but not on others. However, this in turn leads to a new problem, at least for me. Whenever I use -force_load with a relative path to a library, the linker always finds symbol conflicts between the library and itself. It appears that

Linking static library with JNI

霸气de小男生 提交于 2019-11-26 13:55:50
问题 Java versions prior Java 8 requires native code to be in a shared library, but I've read that with Java 8 it's possible to use static linked libraries with JNI. I have searched for examples but couldn't find any. How can I statically link a JNI library into my java application? 回答1: The Java SE 8 specification has been changed to support static linking, and static linking is implemented in the JDK. This is mentioned briefly in the spec for System.loadLibrary. The sections of the JNI

How can i statically link standard library to my c++ program?

邮差的信 提交于 2019-11-26 13:54:30
问题 I'm using Code::Blocks IDE(v13.12) with GNU GCC Compiler. I want to the linker to link static versions of required runtime libraries for my programs,how may i do this? I already know that my executable size will increase,Would you please tell me other downsides? What about doing this in Visual C++ Express? 回答1: Since nobody else has come up with an answer yet, I will give it a try. Unfortunately, I don't know that Code::Blocks IDE so my answer will only be partial. 1 How to Create a

OpenCV as a static library (cmake options)

元气小坏坏 提交于 2019-11-26 13:09:19
问题 I want to use OpenCV library in an embedded system and I need to compile my project using OpenCV as a static library. How can I create the library using cmake options ? 回答1: To build OpenCV as static library you need to set BUILD_SHARED_LIBS flag to false/off: cmake -DBUILD_SHARED_LIBS=OFF .. But I think it is not enough for your task because you actually need to cross-compile library for you architecture. In case of Android or IOS such port already exists and you can simply use it. In case

DLL and LIB files - what and why?

北慕城南 提交于 2019-11-26 12:49:20
问题 I know very little about DLL\'s and LIB\'s other than that they contain vital code required for a program to run properly - libraries. But why do compilers generate them at all? Wouldn\'t it be easier to just include all the code in a single executable? And what\'s the difference between DLL\'s and LIB\'s? 回答1: There are static libraries (LIB) and dynamic libraries (DLL). Libraries are used because you may have code that you want to use in many programs. For example if you write a function

How to link to a static library in C?

若如初见. 提交于 2019-11-26 12:39:57
问题 I use code::blocks to compile my static library. The output result is a libstatic.a file. Now, how do I link to my library to use functions that were compiled? (I tried to use #include \"libstatic.a\" but my project doesn\'t compile) 回答1: cc -o yourprog yourprog.c -lstatic or cc -o yourprog yourprog.c libstatic.a 回答2: You should #include "libstatic.h" , i.e. use the appropriate header file in your code ( that's why your code doesn't compile) and include the path to your libstatic.a in the

Xcode custom build configuration causes “library/file not found” for static libraries

。_饼干妹妹 提交于 2019-11-26 12:39:25
问题 I have a workspace with a project which links with the static libraries in another project (which is also in the workspace). It\'s a problem in Kobold2D I haven\'t been able to resolve, even though I understand the cause, and I suppose it\'s similar to this question. The project targets and the static library targets all have the Debug and Release build configurations. All is well. Now someone adds a new build configuration in the project and names it Ad-Hoc for example. Now the project\'s