static-libraries

How to resolve 'unrecognized selector sent to instance'?

In the AppDelegate, I'm alloc'ing an instance defined in a static library. This instance has an NSString property set a "copy". When I access the string property on this instance, the app crashes with 'unrecognized selector sent to instance'. Xcode provides a code hint for the property, which means it is known in the calling app. The ...

Object Registration in Static Library

I have implemented a very basic "plug-in system" as part of a static library. Each "plug-in" implements the support for a specific image format, e.g. GIF, JPEG, etc.. Furthermore, I have a Singleton (a class called PluginManager) that keeps a list of all available plug-ins. The tricky part is that I want to disable/enable the plug-ins b...

Decrease Qt GUI application size

Hi! I'm learning to develop apps using Qt Creator. I have built a simple app under Windows, depends on uses mingwm10.dll, QtCore4.dll, QtGui4.dll, QtNetwork4.dll. Out of QtQui4.dll I use only a a couple of widgets, and don't need all of the rest... Is it possible to either shrink the size of QtGui4.dll or do something else to decrease de...

How to link with static libraries when building an R package...

I'm creating a package that is going to be used by R (the statistical program), I'm not an expert using this application but I have managed to create a very simple package, using the following logic, I have some classes in C++, as the code has to be compiled using the R compiler and it only allows C code, I have a wrapper C code that cal...

Using "ar" to combine .o and .a files (Linux)

I'm trying to create a single static library which contains object files and existing static libraries which have all been compiled earlier in the build process. Is there an easy way to do this using "ar", or will I need to unpack (ar x library_name) each library and add its object files to my unified library? Thanks! ...

Do I need static libraries to statically link?

On 'C', Linux, Do I need static libraries to statically link, or the shared ones I have suffice? If not, why not? (Don't they contain the same data?) ...

Interface Builder can't see classes in a static library

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...

How to mimic the "multiple instances of global variables within the application" behaviour of a static library but using a DLL?

We have an application written in C/C++ which is broken into a single EXE and multiple DLLs. Each of these DLLs makes use of the same static library (utilities.lib). Any global variable in the utility static library will actually have multiple instances at runtime within the application. There will be one copy of the global variable p...

Why are static library headers not found?

I've used Clint Harris' tutorial to set up code sharing between projects, and everything works just as expected on my computer. But on my co-worker's machine, it seems the compiler doesn't find the header file from the static library project when he builds. My co-worker got my project by cloning a git repository. We've gone through all ...

Implementing Static Libraries In iPhone

Hi All, I have created a static library following this link. But I am facing Problems in using the library. For reference on how to use static libraries in an iPhone project I followed this link . But I am stil struggling with the "How to implement static libraries in any other iPhone project?" question. Thank you all. ...

How to resolve linking error - static lib iPhone

Hi All, I have tried making a static lib on iPhone but I am not able to use it in other project. I am getting this error .objc_class_name_XMLParser", referenced from: literal-pointer@__OBJC@__cls_refs@XMLParser in Minutes2MidnightViewController.o ".objc_class_name_TickerViewController", referenced from: literal-pointer@__...

Categories in static library for iPhone device 3.0

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 mo...

Including a library in Qt, why isn't this working?

This seems like it should be really simple. I compiled a library in Qt (this newmat library), and produced the file libnewmat.a. Now I need to integrate this library into another project but I just can't get it to work. I've tried a few different things with the LIBS variable in my .pro file including: Win32:LIBS += libnewmat.a #libr...

iPhone SDK 3 EXC_BAD_ACCESS with openldap library

Hello, Hope someone can help me, I am trying to build openldap for an app on my iPhoneOS3 but when I try to use something from the library I get this error : Program received signal: “EXC_ BAD_ACCESS”. I followed this website to compile openldap with iphone gcc. So I built openldap with this : export DEVROOT=/Developer/P...

Why doesn't __attribute__((constructor)) work in a static library?

In the following example, the program should print "foo called": // foo.c #include <stdio.h> __attribute__((constructor)) void foo() { printf("foo called\n"); } // main.c int main() { return 0; } If the program is compiled like this, it works: gcc -o test main.c foo.c However, if foo.c is compiled into a static library, t...

Statically and dynamically linking the same library

I have a program that's statically linking to a library (libA.2.0.a) and also dynamically links to another library (libB.so). libB.so also dynamically links to an older version of libA (libA.1.0.so). Is this configuration possible? And if so, how does the system know to use the symbols from libA.2.0.a for my program and the symbols from...

Can a C++ Static Library link to shared library?

Say I have a static C++ lib, static.lib and I want to call some functions from a C++ shared lib, say shared.lib. Is it possible? Now assume that I have another shared lib, say shared2.lib which links to static.lib but does not link to shared.lib. Does the linker automatically link shared2.lib to shared.lib in this case? I am using Micr...

Static code on Solaris?

Question: Why were static libraries /usr/lib/*.a dropped from Solaris 10? So it is NOT possible to generate statically-linked object? Dynamically-linked compilation, is the only option? ...

Atl71.dll denpendency still exists even Static link to ATL is selected

I already spent whole day to trouble shoot this problem, but no luck yet. In my project, I set the Use of ATL property to Static Link to ATL on the General property page and set the Runtime Library property to Multi-threaded (/MT) on the Code Generation property page (C/C++ folder). However DependencyWalker still shows Atl71.dll dependen...

Should I link sqlite3 as plain object code or as a static library in a C++ application?

I am building an application in C++ which uses sqlite3 as an embedded database. The source for sqlite3 is distributed as an amalgamated source code file sqlite3.c and two header files. What are the relative advantages or disadvantages of linking the sqlite3 code directly into my program binary versus compiling sqlite3 as a static libra...