static-libraries

C++/CLI: Compiling static library with /CLR support

We have old (working) code that consists of a static library compiled with /CLR, and a C++/CLI DLL that links to the static lib. We are about to add new features to this static lib. Now, I've have heard from numerous sources that CLR static libraries are not supported by Microsoft, and therefore I'm pushing to clean this up and switch t...

configure.in: AM_DISABLE_SHARED doesn't change my Makefile

I'm extremely new to using Makefiles and autoconf. I'm using the Camellia image library and trying to statically link my code against their libraries. When I run "make" on the Camellia image library, I get libCamellia.a, .so, .la, and .so.0.0.0 files inside my /usr/local/lib directory. This is the command I use to compile my code with th...

Creating an Objective-C++ Static Library in Xcode

So I've developed an engine for the iPhone with which I'd like to build a couple different games. Rather than copy and paste the files for the engine inside of each game's project directory, I'd a way to link to the engine from each game, so if I need to make a change to it I only have to do so once. After reeding around a little bit, ...

Newbie question: How to create and use static libraries in WINARM?

I'm using WINARM Version 20060606 located here: http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/#winarm I want to create a simple static library as follows: ---- plus.h ------------ int plus(int x, int y); ---- plus.c ------------ #include "plus.h" int plus(int x, int y) { return (x + y); } Then I want to sta...

Linkage Error with Inherited Class

I have static library and another program which uses it. In the static library If I define header without inheretence it works fine. class TcpCommunication On the other hand If I use inheretence with a QT class, class TcpCommunication:public QTcpServer I'm getting linkage error when I compiling code which uses this static library...

Is there a way to set a default "role" for headers in Xcode? (I want all my headers public by default.)

I saw this question about changing them all at once, which was helpful. But I was wondering if there is a way to set a (hopefully per-project or per target) default role (public/private/project) for header files? I have a static library project and a main project that depends on it. I often forget to set the header role to public when I...

Hide struct definition in static library.

Hi, I need to provide a C static library to the client and need to be able to make a struct definition unavailable. On top of that I need to be able to execute code before the main at library initialization using a global variable. Here's my code: private.h #ifndef PRIVATE_H #define PRIVATE_H typedef struct TEST test; #endif pri...

iPhone static libraries: How to hide instance variable

I'm creating a static library to share using the following guide: http://www.amateurinmotion.com/articles/2009/02/08/creating-a-static-library-for-iphone.html In one of the functions, I return a "SomeUIView" which is a subclass of UIView and is defined in the public header, however I don't want to expose the internal instance variable o...

iPhone SDK linking errors with static library

Hello all! I've built my own static library with components to be reused in my project, and recently had the need to update a bunch of classes. Specifically, some methods' signatures were changed due to the fact that some classes changed names. What happens now is that the library compiles fine on its own, but, when added to an app pro...

How to static linking to POCO library in VS2005 C++

I have below settings done, but looks like it's still not working. Properties > C/C++ > Preprocessor > Preprocessor Definitions += POCO_STATIC Properties > Linker > Input > Additional Dependancies = PocoNetmt.lib PocoFoundationmt.lib What did I miss? Please advise, thanks. ...

ctypes for static libraries?

Hi all - I'm attempting to write a Python wrapper for poker-eval, a c static library. All the documentation I can find on ctypes indicates that it works on shared/dynamic libraries. Is there a ctypes for static libraries? I know about cython, but should I use that or recompile the poker-eval into a dynamic library so that I can use cty...

Attaching a static library to an iphone/ipad application

Hello, which is the best approach to include a static library with into an application for iPhone or iPad? I could choose to compile the library supplying right platform and building a library file with the ar utility and then add as a framework to the project including the source of the library .c/.h and compile them together with th...

How to force inclusion of an object file in a static library when linking into executable?

I have a C++ project that due to its directory structure is set up as a static library A, which is linked into shared library B, which is linked into executable C. (This is a cross-platform project using CMake, so on Windows we get A.lib, B.dll, and C.exe, and on Linux we get libA.a, libB.so, and C.) Library A has an init function (A_i...

How to build a library for both iPhone simulator and device?

I want to build a static library for iphone. I want to give my users the .a library which they can use for both simulator test and device test. Do I have to build two library in simulator mode and device mode? Is there any way to build a single one that can be used for both platforms? ...

C++ - Basic WinAPI question

Hello! I am now working on a some sort of a game engine and I had an idea to put everything engine-related into a static library and then link it to my actual problem. Right now I achieved it and actually link that library and every functions seem to work fine, except those, which are windows-related. I have a chunk of code in my libr...

dependencies linking isnt enough?

In Visual Studio (C++) the other day, I was trying to build some example code and it would not work, even though I was pointing at the right include and lib directories. (I got linker errors) I asked a friend who fixed the problem by specifying the necessary .lib files in the General Properties->Linker->Input field of the project settin...

Resources in static library question

Hello! This isn't a duplicate of http://stackoverflow.com/questions/531502/vc-resources-in-a-static-library because it didn't help :) I have a static library with TWO .rc files in it's project. When I build my project using the Debug configuration, I retrieve the following error (MSVS2008): fatal error LNK1241: resource file res_yyy.r...

I have an Xcode static library project, how do I add a test target to it so I can run it there? (Instead of in a project that links to it.)

I want to be able to test library code in the library target so I don't have to switch over to a separate project to run it. I see how to add a target, but I'm not sure how to set it up to run like the "Command Line Tool" project template does. I tried adding a new "Shell Tool" target, but I don't know how to make it run like one. What ...

Nested namespaces, correct static library design issues

Hello all, I'm currently in the process of developing a fairly large static library which will be used by some tools when it's finished. Now since this project is somewhat larger than anything i've been involved in so far, I realized its time to think of a good structure for the project. Using namespaces is one of those logical steps. ...

Linking to a C library compiled as C++

I'm in linker paradise now. I have a C library which only compiles in Visual C++ (it probably works in gcc) if: I compile it as C++ code Define __cplusplus which results in all the declarations being enclosed in extern "C" { } So, by doing this I have a static library called, say, bsbs.lib Now, I have a C++ project called Tester whi...