How to create a static library in Xcode 4.2

I need to make a static library from a project that consists of only two files, a c module and a header file.  I haven't used Xcode before, but had no problem figuring out how to create a new project and setting up what seemed like reasonable the build options, and the build reports success.  But no output files are being created.
I figured it was time to dig into the documentation, but when I did some searching I turned up several horror stories about not being able to get this to work.  And from people who appear to know a lot more about this than I do.  So I thought I'd ask--is it a problem doing what ought to be a relatively simple task using Xcode 4.2?
This is not an iOS thing, just a C function that I need to call from Python.
Any suggestions as to how I can get this to work?

Thanks for the response.  Yes, that's how I started.  I have now managed to get it to build static libraries; the piece I was missing was the scheme stuff.  I also tried to build dynamic libraries, but still no luck with those.  It was a little confusing because sometimes if I started a new project the scheme would allow me to create output as is; other times I had to edit the scheme first.  So reading the documentation appears to have paid off after all.
FWIW, what I was trying to build was a missing library needed for a project in Python.  The entire project has two C libraries, which I've managed to build now, altough I don't know if there are some specific options that I need to set for them to work with the C wrapper.  The C wrapper is written in Cython, which creates a C file from Python-like statements.  The end result of linking the two libraries and the compiled C wrapper should be a file that can be imported into Python, which should have an extension of ".so".
So far the last part is not working, so I don't know if the problem is with the build settings for the libraries, or something else.

Similar Messages

  • How to create a static library using xcode ?

    Hi,
    I need to create a C static library using xcode in order to use it in another developement environment which is Free Pascal Compiler/Lazarus.
    I have very few knowledge about C. I just know how to program the function I need and I've already written my C function using xcode.
    Using Lazarus (Pascal IDE), for example, as I use IOKit, I have declared the path of IOKit in the linking section (that is /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/IOKit.framework/IOkit) . IOKit is a unix executable, and I can use the exported functions it contains in my Pascal code.
    So, I would build such kind of unix executable where I can put my own functions written in C. But I can't figure out how to do it.
    How to export my functions ? Must I use some specific C keywords to "publish" them (export, __export,...) ? How to create an executable file like IOKit ? Which kind of project must I choose in XCode ?...
    André.
    Message was edited by: sinfoni12345
    Message was edited by: sinfoni12345

    Thanks for the response.  Yes, that's how I started.  I have now managed to get it to build static libraries; the piece I was missing was the scheme stuff.  I also tried to build dynamic libraries, but still no luck with those.  It was a little confusing because sometimes if I started a new project the scheme would allow me to create output as is; other times I had to edit the scheme first.  So reading the documentation appears to have paid off after all.
    FWIW, what I was trying to build was a missing library needed for a project in Python.  The entire project has two C libraries, which I've managed to build now, altough I don't know if there are some specific options that I need to set for them to work with the C wrapper.  The C wrapper is written in Cython, which creates a C file from Python-like statements.  The end result of linking the two libraries and the compiled C wrapper should be a file that can be imported into Python, which should have an extension of ".so".
    So far the last part is not working, so I don't know if the problem is with the build settings for the libraries, or something else.

  • Creating a static library with XCode cross-project references.

    I have a project and am trying to move a lot of the code into a static shared library, and added a cross project reference to this library in my app.
    However, when I moved a file from my app to the library (removing the reference in my app and moving the file to the library's project directory), and try building my app, I get compiler error messages as if the file I have moved doesn't exist.
    When I build my library project, it says the build has succeeded, but the library.a file remains red. It is also red in the my referencing app project.
    If anybody has any experience setting up cross-project references in XCode, I'd appreciate any help.
    If it helps identify where the problem is, I've performed the following steps to setup the library and cross-project reference:
    1. I created a new Cocoa Touch static library project in XCode which would house the shared code.
    2. I changed the global settings in XCode to place the build products in a shared build directory (rather that the project directory), and made sure the intermediate build files are placed with the build products.
    I changed this using the Preferences menu, but have also gone into the project info for both my app project and the library project and made made sure it is set to place the build projects in the custom shared build directory.
    3. I then added a Source Tree, and made sure that the Path of the project directory of the library project.
    4. I added a project reference to the library project's .xcodeproj file in my application project. I changed the library project reference so that it was relative to JIGSAW24LIBRARY.
    5. I configured the library dependencies by going to my app's target's info, and adding a direct dependency to the library project.
    6. In my app's info build tab, I changed the user header search paths so that it uses the search tree I setup (I used the $(SEARCHTREE_NAME) notation, but checked that this resolves to a valid path). I also made sure that the Always Search User Paths checkbox is checked, and that the Library Search Paths is blank.
    7. I click-dragged the library.a file under the library project so that it was under the Link Binary With Library sub folder of my app's target.
    For step 5, I've also tried adding the reference to the other project as a linked library, rather than a direct dependency, but this doesn't seem to work either.

    I managed to fix the problem. The steps above seem to be correct. The problem seems to be related to the source trees that are defined...
    I was previously using an absolute path for the source tree which pointed at the folder containing the library project. I changed this to a relative path to the same folder (relative from the calling project) and this seems to fix it.
    I'd double checked that the absolute path specified was correct, so it looks like the user header search paths specified must be relative to the current project.

  • LOV How to create a static list

    Hi, I need to create a static LOV in Compensation Workbench in the Employee Allocations table. The static LOV will contain only 4 values.
    Can someone help me by providing detailed instructions on how to create the static LOV.
    Thanks.

    What is the data source for the 4 static values you are looking to use in LOV?
    If you are looking to add this LOV on a seeded page, then I will suggest to go through personalization and customization section of OAF dev guide. Searching through the threads will also give you enough idea to proceed.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Possible to create a static library (.a) file for Xcode with Flash Builder?

    Is it possible to write code in AIR that can be compiled to static library (.a) to be used in an iPad app?

    Hey paulhart83,
    My guess is therabbitwindfall's answer was correct but where you able to find a solution to your question? If so, please do share. I need to embed my app within another app and the only way is through a static library. I'd rather not have to re-develop my app in Xcode in order to generate the .a file.
    Thanks.
    Novian

  • How to link a static library in java

    Hi all
    I would like add a static library (with an extension of ".a") to my java program
    and use the rutines in it. I made a search on the Internet but could not find much.
    The library created by compiling several fortran programs.
    Does anyone know how to do this (linking & calling the subrutines)
    Thanks

    Thanks for the suggestion and for the tip again. I am doing what
    you suggested (writing a C program to interface java with that static library
    ( ".a") ) But where in the C code do you specify and include that static library?This is mainly a linking issue. Suppose the FORTRAN API exposes the following
    functions: FBQ001, FCQ042 and FDB005 (well, this is FORTRAN, so the names
    should be silly ;-)
    For the sake of simplicity, assume that these three routines don't take parameters
    and don't return a value.
    You could create a little Java class that could (indirectly) access those three
    routines:public class FORTRANWrapper {
       public static native void FBQ001();
       public static native void FCQ042();
       public static native void FDB005();
       static {
          System.loadLibrary("wrapperlib");
    }Note the little static block that loads your own wrapper lib. Read on:
    use javah against this little class above. It'll generate a .h file containing the
    prototypes of the three wrapper functions for your FORTRAN API.
    Note the funky names generated by javah. Don't change them but create a
    simple .c file with the implementation of those functions. These functions
    should simply call the FORTRAN functions; check your manuals how to
    call FORTRAN routines from C.
    Finally, compile your .c file and link it against the static FORTRAN .a library.
    Use the correct linker flags (system dependent stuff here) to create a
    shared object (.so) file. This should generate your wrapperlib.so file,
    loaded by the System.loadLibrary method (see above).
    kind regards,
    Jos

  • How to create a new library for my wife's iPod

    Hi all,
    I've been trying to get the right answer to this for a long time, but I seem to be continually coming up against very complicated solutions that are too intricate for me to actually try.  I hope someone will have the knowledge (and the patience with me!) to help.
    My wife received an iPod as a gift from the Mayor of San Francisco.  It came pre-loaded with a bunch of songs about "The City by the Bay."  It's a Nano, so it doesn't have iOS 5, the iCloud, etc.
    So I have two questions. 
    (1) I have my own iPod, iTunes account, and my own laptop.  My wife only has a work laptop so she can't load iTunes onto it (which would make this very simple).
    (2) I would like to be able to create a situation in which:
    (a) She can create her own library on my computer.  Her library would include a lot of music from my library (but not all).  In other words, I want to move some music from my library to her library, both of which are on my laptop.
    (b) She can sync her iPod on my computer.
    (c) She can load all the San Francisco music into "her" library.
    Is there a simple way to do this?  I don't want to do the "separate playlists" variation because that's not how I want to run my own library.  I want that to remain as crisp and clean as possible.
    In short, probably creating a new User account on my MacBook Pro, is there a way that I can "give" her a few dozens of my LPs, but then have pretty separate syncing experiences?  As I say, I've read a million different treatments of this, and they all seem more complicated than I'm ready to do.
    Thank you!!!!

    Or could I just plug her iPod into my computer and "manually manage music"?  What if it's somehow already set to "automatically sync"?  She would lose the music that's already on her iPod, wouldn't she?

  • How to create an Assets Library using C# in SharePoint 2010?

    currentWeb.Lists.Add(
    "List Name",
    "List Description",
    SPListTemplateType.AssetsLibrary);
    This code does not work for me in Visual Studio. The SPListTemplateType enumerator does not have an assets library item.
    How can I programmatically create an Assets Library?

    To create an assets library you must activate first the Site Collection's Publishing Feature in order to set the availabilty of the "Asset Library" template.
    If not, no template on system and of course, error on code "Object reference not set to an Object......"
    Use this code:
    using (SPSite oSite = new SPSite(myUrl))
    if (oSite != null)
    using (SPWeb oWeb = oSite.OpenWeb())
    if (oWeb != null)
    oWeb.AllowUnsafeUpdates = true;
    //activating web feature
    Guid guidCollectionPublishingfeature = new Guid("F6924D36-2FA8-4f0b-B16D-06B7250180FA");
    //activating site feature first
    if (oSite.Features[guidCollectionPublishingfeature] == null)
    oSite.Features.Add(guidCollectionPublishingfeature, true);
    if (site.Features[guidCollectionPublishingfeature] != null)
    SPListTemplateCollection templateCol = web.ListTemplates;
    foreach (SPListTemplate t in templateCol)
    if (t.Name == "Asset Library")
    SPListCollection coll = web.Lists;
    Guid guid = web.Lists.Add("listname", "listdescription", t);
    coll[guid].Update();
    oWeb.AllowUnsafeUpdates = false;

  • How to create the shared library?

    I am new to this topic. I would like to know how I should create the shared library? I followed the provided lesson's steps and in step 5, it states that a shared library has to be create.
    I am using Win2000 and I have installed Visual C++ 6.0, and when I try the command "cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorldImp.c -Fehello.dll", there is an error said that it can't find the mspdb60.dll?
    what is the problem? and what should I do?
    please help.
    Thanks.

    I am new to this topic. I would like to know how I should create the shared library? I followed the provided lesson's steps and in step 5, it states that a shared library has to be create.
    I am using Win2000 and I have installed Devc++ 4.9.8.0 and when I try the command "cl -Ic:\java\include -Ic:\java\include\win32 -LD HelloWorldImp.c -Fehello.dll", but it reports as: "accepting connections" or "press any key to end CL"
    what is the problem? and what should I do?
    please help.
    Thanks. please send me e-mail: [email protected]

  • How to create a JavaMe library that runs on all devices?

    I have the Java ME 3.0 SDK. If I start a Java ME project (Midlet) I have to choose a device that I'm developing for. While I want to create an 'Engine' library that runs on any device. This library won't use any device specific libraries. So if I make different midlets for different devices they can all use the same generic 'Engine' library.
    I've googled a lot on this already and did quite some reading in the documentation of Java ME but didn't find any info on how to do this. I found a way to convert Java projects to midlets with the J2ME plugin for eclipse, but then I'd have to reconvert my Engine project to midlets for every device I want to support every time I make a change in the code of my 'Engine' library.
    Edited by: user8973897 on 23-feb-2011 4:42

    You can find some information here I guess:
    http://www.codeproject.com/Tips/634208/Create-and-Deploy-Custom-Timer-Job-Definition-in-S
    http://www.c-sharpcorner.com/uploadfile/anavijai/custom-timer-job-in-sharepoint-2010/
    http://blogs.msdn.com/b/guruketepalli/archive/2012/01/23/sharepoint-2010-custom-timer-job-send-an-email.aspx
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote ***

  • How to create a document library in Sharepoint Online using Powerpoint?

    I've been trying to create a document library in Sharepoint Online via pwoershell and I've been trying to see if anyone else has the code but the only scripts i could find are for Sharepoint 2010 on-premise and it's not compatible with Sharepoint 2013.
     Can anyone help me?
    Thanks!
    Dearbhla Bradley

    It's SharePoint Client-side Object Model.  Here are few references:
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/dn268594(v=office.15).aspx
    These postings are provided "AS IS" with no warranties, and confers no rights.

  • How to create a UITableView subclass in Xcode 4?

    In Xcode 3 you can create a UITableView option while creating a new class. Now this option is gone and was replaced by an "iPad compatible" option. How can I get to the UITableView option? Or is there any other way to create an UITableViewController?

    Hey Elefantosque,
    I have been creating UITableView classes by doing the following:
    Select NewFile
    Select UIViewControllerSubclass and click Next
    Where it says 'subclass of', use the drop-down menu to select UITableViewController and click Next
    Enter your new file name and click Save.
    I hope this is what you are asking?
    james

  • How to create Universal Mobile App in XCode 4.6.2?

    I am new to Xcode, when I create Universal Mobile App project creating with out IPhone & IPad Folder and it's related files in XCode 4.6.2Version.
    Even I created IPhone folder and created the Application Under IOS->UserInterface it's only creating .xib file it's not creating it's related .h and .m files.
    Can you tell me how can I create the Universal Project. or If I want to add .h & .m files how can I add?
    I don't want to Upgrade XCode version. I want create XCode 4.6.2 Only.
    thanks

    As already provided:
    Wrong forum. You need to post this in the iOS Developer's forum.

  • How to Create .OLB (Object Library)

    I am trying to create object library but i dont i how create them. Please
    give step by step guidance to create it.

    Hello,
    Click the Object Library noed in the Forms Builder's Object Navigator. Then click the + (plus) button.
    Open the new library.
    Create the necessary objects in the form module, then drag them to the library window.
    Francois

  • How to create another form library item in Infopath?

    Hi All,
    I have a Infopath form library and submited a new item successfully. But my requirement is, when i update the same item then it should submit as new item in that form library. How to achieve this in? Thanks in advance!

    Hi Sam,
    According to your description, after updating an item, you want to save it as a new item in the Form Library.
    In SharePoint Form Library, the items with names are not allowed to be created. In this scenario, after updating an item, a workaround is that you can submit the item
    as a new Form Library item with another name.
    To save the current editing item with a new name, we can use a formula to generate a date time string as the “File name”, then each time user submits an updated item,
    there will be a new form created in the Form Library.
    Here is the related formula I use in this scenario, you can change the formula according to your requirement:
    The same Form Library items are submitted with different File Names based on current time:
    Here is a link about adding a submit data connection, you can use it as a reference:
    https://support.office.microsoft.com/en-us/article/Submit-form-data-to-a-SharePoint-library-86e3c32d-d921-4b2e-9d74-89bdc62c6936?CorrelationId=d9e73082-2630-48c6-92c7-c001e15315fa&ui=en-US&rs=en-US&ad=US
    Best regards
    Patrick Liang
    TechNet Community Support

Maybe you are looking for