static-libraries

Static variable initialization over a library

六眼飞鱼酱① 提交于 2019-11-26 16:55:37
问题 I am working on a factory that will have types added to them, however, if the class is not explicitly instiated in the .exe that is exectured (compile-time), then the type is not added to the factory. This is due to the fact that the static call is some how not being made. Does anyone have any suggestions on how to fix this? Below is five very small files that I am putting into a lib, then an .exe will call this lib. If there is any suggestions on how I can get this to work, or maybe a better

Xcode 4 can't locate public header files from static library dependency

风流意气都作罢 提交于 2019-11-26 16:51:38
Alternate titles to aid search Xcode can't find header Missing .h in Xcode Xcode .h file not found lexical or preprocessor issue file not found I'm working on an iOS application project which came from Xcode 3. I have now moved to Xcode 4 my project builds a number of static libraries. Those static libraries also declare public headers and those headers are used by the application code. In Xcode 3.x the headers were copied (as a build phase) to the public headers directory , then in the application project the public headers directory was added to the headers search list . Under Xcode 4 the

How do I build OpenSSL statically linked against Windows runtime?

喜你入骨 提交于 2019-11-26 16:46:11
问题 I'm working on a C++ application for Windows that uses OpenSSL 1.0.1e library. I'm on Visual Studio 2008. For portability reasons my application is statically linked against runtime libraries ( /MT and /MTd options). And I don't ship runtime libs with my application. Per the OpenSSL FAQ, the library is by default linked against multithreaded DLL runtime ( /MDd ) which is obviously incompatible with my scenario. So to make my program work I've added applink.c to my project. On my dev machine

How do I fix warning MSB8012 in a static library project in Visual C++ 2010?

不想你离开。 提交于 2019-11-26 16:37:37
问题 I am trying to convert a static library from VC++2008 to VC++2010, and I get these warnings about TargetPath and TargetName. I have had a look into my configuration and I'm not sure how to make these go away. Is it serious or is it really just an ignorable warning, for a static library that I usually build once and rarely rebuild. I think it has something to do with the fact that the project is named itk32, but the debug version of the library is named itk32d.lib, and the old way that this is

How to use libraries compiled with MingW in MSVC?

允我心安 提交于 2019-11-26 15:49:47
问题 I have compiled several libraries with MingW/MSYS... the generated static libraries are always .a files. When I try to link the library with a MSVC project, Visual Studio throws 'unresolved external symbols' ... It means that the .a static library is incompatible with MS C++ Linker. I presume it has to be converted to a MSVC compatible .lib file. Either .a and .lib are just AR archives of .o or .obj files, so is there any way how to use MingW compiled libs in a MSVC project? Or do I have to

Library? Static? Dynamic? Or Framework? Project inside another project

喜欢而已 提交于 2019-11-26 15:35:25
I have an existing iOS app and want to add a large chunk of code that I've been developing as another project just for ease of testing. The new chunk basically deals with saving an image to various sharing services, etc.. Because that sharing code needs a lot of testing and future updating, I was wondering what the best way to incorporate that code chunk into my existing app. I don't know if it should be a static library, dynamic library or a framework, and honestly, I'm not really sure what the difference is, or how I should go about it and get it set up in Xcode. All I know is that I need

Xcode - symbol(s) not found for architecture x86_64 (iOS Lib)

醉酒当歌 提交于 2019-11-26 15:26:11
问题 I am building a static library. The build setting has the Architectures set to: $(ARCHS_STANDARD) which is shown as Standard Architectures (armv7, armv7s, arm64) I build the lib choosing iOS Device AND then using the simulator (for example iPhone Retina). Now that I have two builds (one inside Debug-iphoneos and the other inside Debug-iphonesimulator , I use lipo -create to create the aggregated lib: lipo -create path/to/first/lib /path/to/second/lib -o MyLib.a If I used this library in

ld linker question: the --whole-archive option

 ̄綄美尐妖づ 提交于 2019-11-26 15:14:32
The only real use of the --whole-archive linker option that I have seen is in creating shared libraries from static ones. Recently I came across Makefile(s) which always use this option when linking with in house static libraries. This of course causes the executables to unnecessarily pull in unreferenced object code. My reaction to this was that this is plain wrong, am I missing something here ? The second question I have has to do with something I read regarding the whole-archive option but couldn't quite parse. Something to the effect that --whole-archive option should be used while linking

How to apply -fvisibility option to symbols in static libraries?

非 Y 不嫁゛ 提交于 2019-11-26 15:11:10
I have a shared library project that is built from 4 static libraries ( .a ) and one object ( .o ) file. I am trying to add the -fvisibility=hidden option to restrict symbols in the output to only those that I mark in the source with an __attribute__. I've added the -fvisibility=hidden option to the compile options for the .so project (which covers the .o file) and for the .a projects. The symbols in the object file are removed as expected from the final .so . However the symbols from the .a projects are all still in the final .so file. Adding the -fvisibility=hidden option to the .so link

What's the difference between .so, .la and .a library files?

北战南征 提交于 2019-11-26 14:58:35
问题 I know an .so file is a kind of dynamic library (lots of threads can share such libraries so there is no need to have more than one copy of it in memory). But what is the difference between .a and .la ? Are these all static libraries? If dynamic libs have big advantages over static ones, why there are still lots of static libraries? I also want to know the underlying mechanism to load libraries (both kinds) and how a piece of code in a lib is invoked when it is used somewhere. Which part of