static-libraries

Include framework in Xcode static library?

我是研究僧i 提交于 2019-12-04 16:58:54
问题 In short: Is there a way to create a static library in Xcode such that when clients link with that library, they also link with the frameworks upon which that library depends? The problem: We have a shared Xcode project which contains multiple static library targets containing all of our common code. E.g., If a project wants to use the shared networking code, all they should have to do is link in our Network library. The problem is that the libraries don't seem to "include" the frameworks on

How to make xcodeproj file relative in Xcode 4.5

亡梦爱人 提交于 2019-12-04 16:50:00
I was following this tutorial and stumbled across this screen shot: apparently there was a way to make the Xcode project file relative to some user defined env variable in earlier versions of Xcode (you get there by highlighting the project file then clicking cmd + i ) I couldn't find a way to this in Xcode 4.5 (the closest I could get to that was this post, but the instructions don't work on Xcode 4.5) ideas? update : I tried the idea of changing the 'header search paths' under build settings.. and setting 'always search user paths' to 'yes' as suggested here .. but then my project always

How to pass arguments to a method loaded from a static library in CPP

淺唱寂寞╮ 提交于 2019-12-04 15:40:49
I'm trying to write a program to use a static library of a C++ code into another C++ code. The first C++ code is hello.cpp : #include <iostream> #include <string.h> using namespace std; extern "C" void say_hello(const char* name) { cout << "Hello " << name << "!\n"; } int main(){ return 0; } The I made a static library from this code, hello.a , using this command: g++ -o hello.a -static -fPIC hello.cpp -ldl Here's the second C++ code to use the library, say_hello.cpp : #include <iostream> #include <string> #include <dlfcn.h> using namespace std; int main(){ void* handle = dlopen("./hello.a",

Debugging a static library in Xcode

筅森魡賤 提交于 2019-12-04 15:14:49
I am building a static library and am receiving no compiling errors, however, when I link it against a demo project(basic single view app). I cannot step into the methods called from the static library to debug it... I'm not receiving any runtime errors, but I think that is because it's not being executed due to the fact my NSLogs are not being shown, and it's not returning anything... Basically, how do I debug a static library I created through the demo app I also created.. What do I do? I need help!! Thanks in advance... To use runtime debugger you should add your static library project as

Library design: Hiding dependencies

ぐ巨炮叔叔 提交于 2019-12-04 15:03:37
问题 I'm attempting to build a library that uses a third-party library internally, but I do not want to expose and of this third-party library to the user of my library. This way, when the static library is built, the user will only need my header and the compiled library. How do I deal with private members in my class definitions that are defined in the 3rd party library? For example . . header: #include "ThirdPartyLib.h" class DummyClass { TypeFromThirdParty tftp; public: bool checkStuff(const

Create and use static library on OS X

牧云@^-^@ 提交于 2019-12-04 13:10:52
OK, I'm trying to create a Cocoa Library (static) and use, but I keep getting errors. I created a super-basic static Library ( TSXLib ) with just one additional class in it. #import <Foundation/Foundation.h> @interface ClassOne : NSObject - (void)doIt; @end #import "ClassOne.h" @implementation ClassOne - (void)doIt { NSLog(@"Oops... I did it again!"); } @end Then, I set the Dynamic Library Install Name (in Build Settings) to : @executable_path/../Frameworks/libTSXLib.a Now in my Test Project : I drag'n'drop the libTSXLib.a file (and copied it to target) Added a Build Phase (Copy Files) where I

Linking with static library not equivalent to linking with its objects

核能气质少年 提交于 2019-12-04 12:58:44
Problem: The firmware image generated when linking with a static library is different to the firmware image generated when linking with the objects directly extracted from the static library. Both firmware images link without error and load successfully onto the microcontroller. The latter binary (linked with objects) executes successfully and as expected, while the former (linked to the static library) does not. The only warnings during compilation are unused-but-set-variable in the manufacturer-supplied HAL, which due to various macro definitions are not necessary for the compiled

How to use FLAC in iPhone application?

醉酒当歌 提交于 2019-12-04 12:10:45
问题 I'm developing iPhone app that should use Google Voice API, so my app should convert voice recorded in m4a to flac. Of course I should use libflac, but all my attempts to compile static library for iOS were failed due to linker errors. So the question is: where could I find static iOS binaries of libflac or what should I do to compile it? 回答1: ScummVM has libflac in their iPhone setup. See: http://wiki.scummvm.org/index.php/Compiling_ScummVM/iPhone I'm sure you can look over their setup to

Building A static version of Qt 5.2.1 with Visual Studio 2013

拜拜、爱过 提交于 2019-12-04 11:11:46
问题 I have been trying for a few days now to build a static version of Qt with Visual Studio 2013. I just cannot figure out what I did wrong. System: Windows 7 64 bit Visual Studio 2013 (Visual Studio 2012 is still installed) Perl is installed (ActivePerl-5.18.2.1801-MSWin32-x64-297964.msi) Python is installed (python-2.7.6.amd64.msi) Direct X 10 SDK is installed (DXSDK_Jun10.exe I had to use this workaround) Downloaded Qt 5.2.1 Downloaded Qt 5.3.0 alpha What I did multiple time: Extract the

Create a C wrapper around a C++ library that can be linked by a C linker

有些话、适合烂在心里 提交于 2019-12-04 10:44:32
Following the answer given to this question (Developing C wrapper API for Object-Oriented C++ code) I managed to write a C wrapper for my C++ code. I would like to compile and link my wrapper into a static library (compiled using g++) that could be used, compiled and linked using gcc only (not g++). This way the user of the library would not have to care that the library is written in C++. Is this something possible? Neil Neyman This link explains some of the compiler options and scenarios: http://docs.oracle.com/cd/E19422-01/819-3690/Building.Libs.html Specifically: > 16.7 Building a Library