static-libraries

Determining the CPU architecture of a static library (LIB) on Windows

I just built libpng on a 64-bit Windows machine using VS2008. It produces a libpng.lib file inside the \projects\visualc71\Win32_Lib_Release directory (Configuration used being "LIB Release"). I used dumpbin to inspect this LIB file: C:\Temp\libpng-1.4.3>dumpbin projects\visualc71\Win32_LIB_Release\libpng.lib Microsoft (R) COFF/PE Dum...

problems using cross-compiled library

Hello guys, I've cross-compiled a library called Adol-c on linux for windows (mingw). It seems to be ok, but when I try to link this new cross-compiled library (libadolc.a) in my project on windows i find the following problems: g++ -LC:\1500TB\libs\Cross-ADOL-C-2.1.0\adolc_base\lib -mwindows -oteste.exe src\main.o -ladolc -lstdc++ -...

Why is my static library so huge?

I have a C++ compiled static library of about 15 classes and their member functions and stuff, and compiled, it's almost 14 megabytes. It links to Google's dense hash table library and MPIR, which is like GMP for Windows, but I did that in a plain exe and it was a few kilobytes. Why is it so massive? What can I do to reduce its size? It ...

Dynamic targets in Makefiles

I'm trying to create a Makefile that has a target per src/ subfolder so that it creates a static lib. I am currently trying this: %.o: %.cpp $(CXX) $(CXXFLAGS) $(INCLUDE) -c -o $@ $< lib%.a: $(patsubst %.cpp, %.o, $(wildcard src/%/*.cpp)) $(AR) rcs $@ $^ But this doesn't work, the target matching works, but the dependency tra...

Can Xcode and iPhone handle hundreds of static libraries?

I'm trying keep xcode chaos under control. Namely, how to reuse my small components/classes between projects. One strategy is to make every class, or tightly coupled collection of classes, in to a static library, each being a spawn of a different sub project with a few targets like unit tests, demos, and, of course, the library. The wa...

Export function in c++ static library

My app links to a third party static library which without source code and I find that a function implemented in this library is exported in my exe using dumpbin.exe, just like a export function in a DLL. I have tried to modify the header file provided by the library, got rid of all the __declspec(dllexport) stuffs, and relink my app, b...

iPhone sdk, class heritage in static library

i'm developing a static library using iPhone sdk. like others, this includes a .a file, as well as some .h files. I'd like one of my classes to inherit from another class in my static library. this class is declared in a .h file which i'm exposing (outside .a), although the parent class is not exposed (inside .a). how can i do this?...

How to make Xcode 3.2.3 build a specfic architecture?

I'm getting the following error when including static libraries: missing required architecture i386 in file This worked 30 seconds previously, and only failed when I upgraded to Xcode 3.2.3. I've used "file" command to check - and, yes, XCode is building completely the wrong architecture (armv6 + armv7 instead of i386). This se...

Unable to add libpng library in my project

Hello developers, I am new to iphone developmenet. I'm trying to load PNGs using libpng but I'm unable to add it to my project after trying so much. I've got following errors while adding libpng to my project. Plz help me how to get rid of these errors: "_deflateReset", reference from... "_inflateEnd", referenced from... "_*inflate", ...

Statically link ncurses to program

I'm having some problems statically linking ncurses to one of my programs Here's a really simple sample program: #include<ncurses.h> int main(){ initscr(); printw("Hello world\n"); refresh(); getch(); endwin(); return 0; } When I compile it with gcc -static -lncurses hello_curses.c -o curses I get these...

Is it possible to create a static library (single .lib file) that can be later compiled with either /MT, /MTd, /MD or /MDd?

Instead of creating 4 different libs (one for MT, MTd, MD, MDd) I want to create a lib that does not specify its dependency on C runtime library (CRTs). I tried to pass "/c /Zl" option to vc10 compiler, then /NODEFAULTLIB to lib command. Later when I use such lib I still have errors when I compile my program with switch different than d...

How do you produce one static library for both release/debug on the iPhone?

I would like to release a static library similar to what PayPal did (https://www.x.com/community/ppx/xspaces/mobile/mep) for the iPhone. They were successful in incorporating both the release/debug version of their static libraries into one single *.a file. I have found solutions to combine simulator/device static libraries but not comb...

How do PayPal incorporate UI elements and image resource into a iPhone Static Library?

I am trying to make a static library similar to what PayPal has done (https://www.x.com/community/ppx/xspaces/mobile/mep) for the iPhone. It looks like PayPal is able to integrate views into the library as well as image resources. The only solution I can think of is to code the UI by hand for the UI and produce binary data for the imag...

incorporate .so into another .so without dependency?

i have a c program that relies on a second library whose compilation i can control. i want to be able to compile my program into a shared object library without it linking to the second library. in other words i want a single monolithic shared object library at the end. how can i do this? if i separately compile the second library into ...

How to stop using DLL and statically link to a LIB?

I have a VB 20008 Express project which currently uses a DLL. I would rather distribute a single .EXE I used DLL2lib and converted it to a library, but as I haven't done this before, How can remove the DLL from my project? The Project menu has an "Add resource" option, but I can't find any way to remove it (it doesn't show up in Proj...

Problem with header files & c++ files

Hi, I'm creating a minimal circle-circle physics engine in a static library, and I've came across a problem. I have a header file for object manipulation, one of the variables is the objects position. The position variable is declared in bpObject.h, and I have a void function, SetPosition(), that accesses the current position and sets ...

Static library (.lib) to Python project

Hi, is it possible to import modules from .lib library to Python program (as simple as .dll)? ...

Is it possible to link FFmpeg statically into an application built with Visual C++?

Hi, I'm currently building and using FFmpeg on Windows and it works nicely. At present there are 5 relevant DLLs which I load and map relevant functions in as needed. However I am wondering if it is possible to avoid these DLLs by linking FFmpeg statically? My initial reaction is probably not, because the FFmpeg builds are done with Mi...

No additional dependencies required for a LIB but are required for a DLL

I have a framework (in C++) which is dependent on a few third party libraries. When I compile a static version of the library framework, no additional dependencies are needed, that is, the lib files of the third part libraries are not needed. When I compile the same framework as a DLL, additional dependencies are now needed otherwise I g...

g++ linker: force static linking if static library exists?

I've a program which links to many libraries. g++, by default, prefers to link to shared libraries , even if corresponding archive exists. How can I change this preference to prefer static archive over dynamic libraries , if a static archive exists. Note , I used '-static' option, but it tries to find static archive for all libraries whi...