static-libraries

Throwing C++ exceptions outside static library?

独自空忆成欢 提交于 2019-11-30 18:58:47
As a rule, exceptions must not propagate module boundaries as for example explained in Herb Sutters C++ Coding Standards (item 62). When compiled with different compilers or just compiler settings this might crash. I can understand the issue in case e.g. of dynamic link libraries. But I wonder whether it also holds for static libraries. Is a static library a module in the sense of the above rule? If the library is compiled with other compiler settings (e.g. alignment) might the program crash, if an exception is thrown out of the static library and caught in the application? Generally, a static

Is it possible to unit test a static library project using XCode's SenTestingKit?

眉间皱痕 提交于 2019-11-30 17:36:33
I've created an iOS unit test target for doing logic tests following the steps provided in Apple's documentation. However my build fails and i get the following error: Undefined symbols: "_OBJC_CLASS_$_MyClass", referenced from: objc-class-ref-to-MyClass in LogicTests.o ld: symbol(s) not found collect2: ld returned 1 exit status Ordinarily, if I wanted to use my static library within an application I would include the library.a file, and the headers(including the MyClass.h file...). Is something additional required to run logic tests on a static library WITHIN that same project if my test

Compiling ghc with -fPIC support

心不动则不痛 提交于 2019-11-30 17:19:22
I'm trying to install GHC with -fPIC support in Fedora. I've grabbed a source tarball since it seems no binary one has this. In Build.mk i've changed the quick build type to ifeq "$(BuildFlavour)" "quick" SRC_HC_OPTS = -H64m -O0 -fasm -fPIC GhcStage1HcOpts = -O -fasm -fPIC GhcStage2HcOpts = -O0 -fasm -fPIC GhcLibHcOpts = -O -fasm -fPIC SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO endif unfortunately, when compiling i still get the ld error ghc -fglasgow-exts --make -shared -oHs2lib.a /tmp/Hs2lib924498/Hs2lib.hs dllmain.o -static -fno

Geospatial library for the iPhone

人走茶凉 提交于 2019-11-30 17:07:08
I'm thinking about creating a location-aware iPhone app that could work offline by coming packaged with a list of points of interest (POIs). The app would read the user's current location from CoreLocation and produce a list of the POIs in order of proximity to the user's current location. I need two basic geospatial functions to get this application off the ground. The first is a function that tests if a point (the user's current location) lies within certain geospatial boundaries. The second is a function that can give me the distance between two lat/lon points. I would use the second

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

一笑奈何 提交于 2019-11-30 16:58:23
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, the program prints nothing. gcc -c main.c gcc -c foo.c as rcs foo.a foo.o gcc -o test foo.a main.o Why does this happen? The linker does not include the code in foo.a in the final program because nothing in main.o references it. If main.c is rewritten as follows, the program

OpenSSL Static Library too big, any alternative or way to reduce its size?

对着背影说爱祢 提交于 2019-11-30 15:25:47
I have used pre-build static libs of OpenSSL 1.0, but it makes my binary too big, (increase its size by about 800Kb in release mode). I do not need most of the feature of OpenSSL such as BIO, I use my own sockets, therefore in the code I am only using a couple of SSL_XXXXXXXXX calls(SSL_accept(3) or SSL_connect(3), SSL_read(3) and SSL_write(3)) My only requirement is support SSLv2/v3 with winsock on windows, and sockets on linux for both client and server side (for C++) Is there anyway to make OpenSSL much smaller (maybe by compiling it myself) or, in last resort, any other good but more

Android NDK: Trying to port JnetPcap

社会主义新天地 提交于 2019-11-30 15:25:34
I found a traffic monitoring application for Android, Shark: http://sourceforge.net/projects/prueba-android/ which is based on JnetPcap and has a file with all the source files and the appropriate Android.mk files. I put the jni directory in the samples file of the Android-NDK and I tried to build it using ndk-build -C. During the compilation occurs some errors. Here is the error log I take: make: Entering directory `/home/thanasis/android-ndk-r5b/samples /jnetpcap_pure/jni' Compile thumb : jnetpcap <= util_crc16.c Compile thumb : jnetpcap <= util_crc32.c Compile++ thumb : jnetpcap <= jnetpcap

Link Objective-C application to C++ static library

僤鯓⒐⒋嵵緔 提交于 2019-11-30 15:14:03
问题 I am trying to use Xcode to build an Objective-C desktop application that links against a static C++ library. I am using the Apple's clang compiler. I am getting the following linker error: Apple clang version 3.0 (tags/Apple/clang-211.12) (based on LLVM 3.0svn) Target: x86_64-apple-darwin11.2.0 Thread model: posix "/Developer/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.7.0 -syslibroot /Developer/SDKs/MacOSX10.7.sdk -o /Users/andrew/Library/Developer/Xcode/DerivedData

Turn thin archive into normal one

雨燕双飞 提交于 2019-11-30 14:02:27
I'm building V8 , and by default it builds as a "thin" archive, where the .a files essentially just contain pointers to the object files on your filesystem instead of containing the object files themselves. See man ar for details. I want to be able to put this library in a central place so that other people can link to it, and it would be obviously much easier to provide a normal archive file instead of providing a gaggle of object files as well. How do I take the thin archives produced by the build and turn them into normal ones? I assume it would be as simple as enumerating the object files

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

人盡茶涼 提交于 2019-11-30 11:36:09
问题 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 Dumper Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file projects\visualc71\Win32_LIB_Release\libpng.lib File Type: