static-libraries

Static initialization and destruction of a static library's globals not happening with g++

巧了我就是萌 提交于 2019-12-28 12:14:45
问题 Until some time ago, I thought a .a static library was just a collection of .o object files, just archiving them and not making them handled differently. But linking with a .o object and linking with a .a static library containing this .o object are apparently not the same . And I don't understand why... Let's consider the following source code files: // main.cpp #include <iostream> int main(int argc, char* argv[]) { std::cout << "main" << std::endl; } // object.hpp #include <iostream> struct

How to check if a static library is built for 64-bit?

一笑奈何 提交于 2019-12-28 07:30:21
问题 I just built a static library for iOS with the build setting for Architectures set to $(ARCHS_STANDARD_INCLUDING_64_BIT) . I want to make sure that the .a library is properly including that architecture, but when i run lipo -info on it, I see: Architectures in the fat file: library.a are: armv7 armv7s (cputype (16777228) cpusubtype (0)) Does this mean that arm64 isn't included? If the lipo command can't tell me, is there another way to tell? I'm running Xcode 5 with the latest Command Line

How to check if a static library is built for 64-bit?

落爺英雄遲暮 提交于 2019-12-28 07:30:04
问题 I just built a static library for iOS with the build setting for Architectures set to $(ARCHS_STANDARD_INCLUDING_64_BIT) . I want to make sure that the .a library is properly including that architecture, but when i run lipo -info on it, I see: Architectures in the fat file: library.a are: armv7 armv7s (cputype (16777228) cpusubtype (0)) Does this mean that arm64 isn't included? If the lipo command can't tell me, is there another way to tell? I'm running Xcode 5 with the latest Command Line

XE4 ( Firemonkey + iOS Static Library) , Pascal conversion from Objective C Class?

混江龙づ霸主 提交于 2019-12-28 06:34:05
问题 How to Conversion ? (Objective C Class -> Delphi XE4 ) and How to use Objective-C Class in static Library from Delphi XE ? Following is the my first trial. But It makes error. Objective C Source // objective C : test.h ---------------------------------------- @interface objc_test : NSObject { BOOL busy; } - (int) test :(int) value; @end // objective C : test.m ---------------------------------------- @implementation objc_test - (int) test :(int) value { busy = true; return( value + 1); } @end

Statically linking GTK+ libraries in windows

↘锁芯ラ 提交于 2019-12-28 06:32:13
问题 I have installed GCC and GTK+. Its working fine, but i need to statically link GTK+ libraries with my application (it's a small application) so that there exist only one '.exe'. 回答1: It is supported with a few minor issues (like having trouble finding configuration files), but you will have to compile GTK+ yourself! (the default binaries do not include static libraries) See this mailing-list thread for more information on this issue. 回答2: mingw-cross-env has fixes to build gtk and all related

How to build an Objective-C static library?

倖福魔咒の 提交于 2019-12-28 04:51:08
问题 I have some Objective-C classes, which I am currently using in both a Cocoa application (Mac OS X) and a Cocoa-Touch application (iOS). Currently, when I update those classes, I have to copy those updated .h and .m files to both projects. Not that big of deal, but I'm going to be using them in many more projects. So, I want to build these classes into an Objective-C static library. And then link against that library in all other projects. Is there a way to build a static library such that it

What is the use of .exp and what is the difference between .lib and .dll?

為{幸葍}努か 提交于 2019-12-28 04:51:04
问题 During compilation and linking, what is use of .exp? What is the difference between .lib and .dll? I know that .lib will be used, while linking and .dll will be used when running the program. But what exactly is the difference between .lib and .dll? Does .lib file not contain the code for the functions coming from .dll files? What is the need for using two separate files? Please clarify. 回答1: In the case of an import library for a DLL, the .lib file does not contain any actual code at all. It

How to build an Objective-C static library?

China☆狼群 提交于 2019-12-28 04:51:04
问题 I have some Objective-C classes, which I am currently using in both a Cocoa application (Mac OS X) and a Cocoa-Touch application (iOS). Currently, when I update those classes, I have to copy those updated .h and .m files to both projects. Not that big of deal, but I'm going to be using them in many more projects. So, I want to build these classes into an Objective-C static library. And then link against that library in all other projects. Is there a way to build a static library such that it

Undefined symbols for architecture x86_64 - Mavericks (Yosemite, El Capitan…)

╄→尐↘猪︶ㄣ 提交于 2019-12-28 03:38:11
问题 EDIT : If you fall on this post, you may want to jump directly to the answer I sent a post about my confusion earlier this morning machine type (C++ librairies) : i386 vs x86_64 But I guess I did a mistake by being not precise. So I decided to give an example of situations I face and that I can not understand. STEP 1 I build a library on machine A, a 2 years old mac with OS x 10.7.5 (that I guess is 64 bits; my guess being based on the commands you will see below in Additional Info) using the

Create a Static Library on Windows Which Is macOS and Linux Compatible

时光毁灭记忆、已成空白 提交于 2019-12-25 18:24:39
问题 I would like to generate a Static Library file in Windows using MSVC / IXX which is macOS and Linux compatible. I'm using C (Let's say C99 ) and the functions are really simple. For example: void AddArray(float* mA, float* mB, float* mC, int numElements){ int ii; for(ii = 0; ii < numElements; ii++){ mC[ii] = mA[ii] + mB[ii]; } } Is there a way to build the Library only once on Windows and use it everywhere? If not on windows, could it be done on Linux and work on Windows and macOS? The idea