static-libraries

The workspace with the iOS project and related a static library project

為{幸葍}努か 提交于 2019-12-02 19:39:55
I am fighting with Xcode 4 workspaces. Currently Xcode 4 wins. Thus, my situation: I have the workspace with the iOS app project. There is also static library project iOS app depends on in the this workspace. Solution #1 I try to configure like this: the app project: add to target's Build Phases > Link Binary With Library a product ( libmystaticlib.a ); set USER_HEADER_SEARCH_PATHS to $(TARGET_BUILD_DIR)/usr/local/include $(DSTROOT)/usr/local/include ; the static library project: add some header files to target's Build Phases > Copy Headers > Public ; set SKIP_INSTALL to YES . And important

linking to a static 0MQ library in VS

我的梦境 提交于 2019-12-02 19:32:36
This may be a Visual Studio question more than anything else... I'm trying to build a 0MQ C++ example using VS10 and ZeroMQ 2.2.0. I downloaded the windows sources and tried to follow these instructions in order to build 0MQ statically. Specifically: Switched to Release For all 7 projects in the solution: set General\Configuration Type to Static library (.lib) set C/C++\Code Generation\Runtime Library to Multi-threaded (/MT) added ZMQ_STATIC to C/C++\Preprocessor\Preprocessor Definitions Updated zmq.h and zmq_utils.h so that if _MSC_VER and ZMQ_STATIC are defined then DLL_EXPORT will also be

Add .so and .a libraries to Makefile

醉酒当歌 提交于 2019-12-02 19:31:56
I have a makefile which looks like this . DEFINES=-std=c++0x INCS_GTK=-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gtk-2.0/gdk -I/usr/include/pango-1.0 -I/usr/lib/gtk-2.0/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include INCS=-I/usr/include/freetype2 -I/usr/include/mysql -Iframeworks ${INCS_GTK} LDLIBS=-lconfig++ -lcxcore -lcv -lGL -lGLU -lglut -lhighgui -lSDL -lftgl -lueye_api -lboost_filesystem -lboost_system -lann -lpthread -lflycapture -lglog -lmysqlpp

How to deal with recursive dependencies between static libraries using the binutils linker?

a 夏天 提交于 2019-12-02 19:20:15
I'm porting an existing system from Windows to Linux. The build is structured with multiple static libraries. I ran into a linking error where a symbol (defined in libA) could not be found in an object from libB. The linker line looked like g++ test_obj.o -lA -lB -o test The problem of course being that by the time the linker finds it needs the symbol from libA, it has already passed it by, and does not rescan, so it simply errors out even though the symbol is there for the taking. My initial idea was of course to simply swap the link (to -lB -lA) so that libA is scanned afterwards, and any

What is a dynamic language, and why doesn't C# qualify?

℡╲_俬逩灬. 提交于 2019-12-02 17:05:44
Listening to a podcast, I heard that C# is not dynamic language while Ruby is. What is a "dynamic language"? Does the existence of dynamic languages imply that there are static languages? Why is C# a dynamic language and what other languages are dynamic? If C# is not dynamic, why is Microsoft pushing it strongly to the market? As well why most of .NET programmers are going crazy over it and leaving other languages and moving to C#? Why is Ruby "the language of the future"? What is a dynamic language? Whether or not a language is dynamic typically refers to the type of binding the compiler does

CMAKE - How to properly copy static library's header file into /usr/include?

大城市里の小女人 提交于 2019-12-02 17:01:10
I'm getting into CMAKE usage with C and actually I'm creating two very small static libraries. My goal is: The libraries are compiled and linked into *.a files. [THIS WORKS] Then I wish to copy that *.a files into /usr/local/lib [THIS ALSO WORKS] As far as I know about libraries (very little), they are linked using -lnameoflib , which is a compiler flag. OK. I have prepared my CMakeLists.txt and it actually copies *.a files into /usr/local/lib . However, to be able to use them in a program, I also need to copy their header files into /usr/local/include , then I can include them the easy way

Building a static library with cocoapods

流过昼夜 提交于 2019-12-02 16:48:37
I am trying to build a static library that has different dependencies (AFNetworking for example) specified in a Podfile. I don't want the dependencies to be included in the final static library (call libMyProject.a), I just want to link against them and then create a MyProject.Podspec file where I can put the same dependencies. The problem is that when I build libMyProject.a the libPods.a is linked and included, so that if I distribute libMyProject.a and other people integrates it in a project which uses some of the same dependencies it will have duplicate symbols issues. How can I link

What is the difference between .o .a and .so files?

只愿长相守 提交于 2019-12-02 16:18:42
I know .o are object files, .a are static libraries and .so are dynamic libraries? What is their physical significance? When can I use some and when not? .a is an "archive". Although an archive can contain any type of file, in the context of the GNU toolchain, it is a library of object files (other toolchains especially on WIndows use .lib for the same purpose, but the format of these is not typically a general purpose archive, and often specific to the toolchain). It is possible to extract individual object files from an archive which is essentially what the linker does when it uses the

How to Expose C Static Library to .Net?

陌路散爱 提交于 2019-12-02 14:47:58
问题 What are the steps to expose C++ functions to C and .Net? I want to use the same function names in C++, C and .Net for 32-bit and 64-bit builds. I'm posting this question and answer because I haven't found these techniques documented anywhere. 回答1: The steps are: Expose C++ functions as a C static library (.lib). Use #pragma statements to project the lib's functions into a DLL. Use .Net's DllImport attribute to expose the DLL's functions. For an example, see this github project. Step 1.

How a standard library differ from user defined header file (.h) and its implementation file (.c) in C?

廉价感情. 提交于 2019-12-02 13:40:26
How a standard library like libc.a (static library) which is included using #include <stdio.h> in our main.c differ from user defined header file (cube.h) included in main.c with its implementation file (cube.c) in C ? I mean both are header files but one's implementation is a static library (.a) and others is source file (.c) . You would have the definition (implementation) in, say, cube.c #include "cube.h" int cube( int x ) { return x * x * x; } Then we'll put the function declaration in another file. By convention, this is done in a header file, cube.h in this case. int cube( int x ); We