static-libraries

Accessing linux local file system from java web application

笑着哭i 提交于 2019-11-28 10:17:03
问题 we are using a java library inside a web application which is hosted in apache server.ReadConfFile method in library returns file not found error.The method is as follows public byte[] ReadConfFile() { try { File file = new File("/home/product/api/conf.txt"); if(!file.exists()) return "file not found".getBytes(); byte[] buf = new byte[(int) file.length()]; FileInputStream fis = new FileInputStream(file); fis.read(buf); return buf; } catch (IOException e) { e.printStackTrace(); return null; }

How to add static libraries inside a C++ project with Xcode

Deadly 提交于 2019-11-28 10:00:42
I'm developing a C++ project by using Xcode 4.6.1 as IDE. Now, I'd like to add a static library mylib.a and the related header mylib.h . I read about this solution , but it doesn't work (while clicking on Target Dependencies , the box is still remaining empty). Is there a way to achieve this task? UPDATE: I created a group , then I added the file mylib.a on it. It seems to work fine, but at compile-time a warning as follows appears: ld: warning: ignoring file /Users/vdenotaris/Desktop/Code/MyStaticLib/mylib.a, file was built for archive which is not the architecture being linked (i386):/Users

Linking and LOADING static .lib with mex

随声附和 提交于 2019-11-28 09:49:21
问题 So, I have a MEX gateway script file that calls my C source code. I've used the -L and -I commands to link my 64-bit compiled GSL libraries (.libs) to my mex executable, which is then compiled under the extension of .mexw64. I want for this executable to be transferred to another windows machine and run fine, without any GSL libraries installed. That is the the only solution, I don't care what he arguments are regarding the benefits of the dynamic linking/code generation upon compile-time are

How to build a C library for iOS by Xcode 6?

风流意气都作罢 提交于 2019-11-28 09:47:39
问题 I trying to build C library for iOS like the following picture. I have build the liblib.a , but it compile error after I use liblib.a The error log is like the following when I use liblib.a file was built for archive which is not the architecture being linked (armv7): /Users/apk/Desktop/libTest/liblib.a Undefined symbols for architecture armv7: It seems the liblib.a not support for armv7 , but I didn't find the armv7 and the arm64 in Build Setting -> Architectures. How do I build the library

XCode 4.3: Static Library Generation

泪湿孤枕 提交于 2019-11-28 08:48:44
I've done a some looking around but most of the answers I've found have been or felt incomplete and have left me a little confused. I have been given a C Library that I need to compile into a static library using XCode 4.3 and then use in a separate iOS app project, but I'm unsure about how to proceed. I'm not sure if the directory structure matters or not, but here it is anyways: Library -> Section1 -> src -> .c files -> sec1 -> .h files -> sec1.h -> Section2 -> src -> .c files -> sec2 -> .h files -> sec2.h I've been trying to work from this: http://blog.stormyprods.com/2008/11/using-static

ObjC: How to compile static library that includes optional classes that depend on a third party library

人走茶凉 提交于 2019-11-28 08:45:48
I'm trying to find the best way to package a static library(lets call it Lib1) that includes an optional class(say, ClassA), which itself requires a second static library(Lib2). In other words, Lib2 is only needed if ClassA is referenced in the project's code. Things seem to work fine, unless Lib1 is used in a project that doesn't use ClassA(and hence does not include Lib2), but requires the -ObjC linker flag(because of other project dependencies, not mine). I'm trying to come up with a an easy solution for the following three scenarios: 1) project includes my static lib, does NOT use the

Linking multiple static .lib files into one monolithic .lib file using VS2008 SP1 using CMake 2.8.x

…衆ロ難τιáo~ 提交于 2019-11-28 08:44:12
Related to using cmake to link object files into lib.xxxx.a file , but not quite the same thing, I have built several static libraries on Windows using CMake 2.8.x using VS2008 SP1. Is there a way via CMake alone to relink all of the .obj files inside all of those existing static libraries into one larger monolithic library, preferably via the add_library CMake function, or other similar construct? I think the answer is "no", and so I have thought about rolling my own via a custom command via the usual add_custom_command + add_custom_target approach, that simply constructs the library manually

Installing OpenSSL library for Xcode

对着背影说爱祢 提交于 2019-11-28 08:30:51
I have installed OpenSSL in xcode for receipt validation, but it doesn't work. I download openssl.xcodeproj and openssl-1.0.1f . I extract openssl-1.0.1f and add openssl.xcodeproj to my project. I edit the Header Search Path to : /Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl I added libcrypto.a in Target Dependencies under Build Phases and added libcrypto.a in Link Binary With Libraries as was described in http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/ . But when I build project it stops with error : clang: error: no such

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

安稳与你 提交于 2019-11-28 07:25:54
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 Object { Object() { std::cout << "Object constructor called" << std::endl; } ~Object() { std::cout <<

Detect and use optional external C library at runtime in Objective-C

点点圈 提交于 2019-11-28 06:33:59
I am building an SDK that iPhone developers can include in their projects. It is delivered as a compiled ".a", without source code. Let's call my SDK "AAA". The customer in his project (let's call it "BBB"), in addition to use AAA, may also use a 3rd party library called "CCC" - which also comes pre-compiled, closed-source. I do not sell CCC, it's a different company. My SDK, AAA, can optionally use CCC to improve the product, using those 3rd party features. For example, let's say CCC is a security SDK to encrypt something. AAA does not require CCC, but will be more secured if the customer