How to use xcode to compile standard C prgram

Hi all,
I am a new developper in xcode. I have several standard C programs written by myself before.
I have problem to open them with the new xcode (4.1 i guess). If I drag the program folder to xcode icon, nothing happens. I noticed through xcode I can start a new project or workspace, then I can add my program to it.
However, problem still exists. e.g. my program contains several files (*.c *.h), if I select one variable and select go to the definition of it, xcode cannot find the definition.
Besides I cannot debug neither run the program in xcode.
Normally I compile my codes with gcc or icc in terminal, but now I am totally lost in xcode. I know my questions sound silly, hope some guys can help me out of it and I will appreciate a lot.
Mono

First, if you normally compile your code in the Terminal, you can keep doing that. You don't have to use Xcode.
In Xcode 4 every program requires a project, even simple command-line programs. Create a command-line tool project. Choose File > New > New Project to create a new project. Select Application under Mac OS X on the left side of the New Project Assistant. Select Command Line Tool from the list of application projects. Click the Next button. Choose C from the Type menu. Name the project. Click the Next button. Select a location to save the project and click the Create button.
After creating your project, add your source code files to the project. Choose Files > Add Files to ProjectName to add the files to your project. You may need to delete the main.c file Xcode created when you created the project.
If you want to debug your project, click the Breakpoints button in the project window toolbar. Click the Run button in the toolbar to build and run your project. If you click the Breakpoints button, your program will run in the debugger. If you don't see the debug area at the bottom of the project window when running your program, choose View > Debug Area > Show Debug Area to show it. You need the debug area open to do command-line input and output in Xcode.

Similar Messages

  • Can someone explain to me how to use Xcode?

    I just got the app Xcode and I am so exited to use it. But once I tried it, I was so confused. Can someone explain to me how to use Xcode?

    Become a paid developer, download all the thousands of manual pages and read them.
    developer.apple.com

  • Is there instructions on how to use Xcode

    hi messing around with developing  is there instructions on how to use xcode not sure how 'hello world' useing c coding is working also theres a lot of options? read the java tip but really i dont know were to start

    no need to answer this i have seen were it is

  • I'm trying to learn how to use Xcode. I've create a simple Hide App app from a youtube video tut, but I can't get it to export with the icon I've chosen. Any clues why?

    I'm trying to learn how to use Xcode. I've create a simple Hide App app from a youtube video tut, but I can't get it to export with the icon I've chosen. Any clues why?

    We didn't do that video. Why are you asking here?
    Those videos are usually outdated....
    Use the current tools etc., in the iOS Dev Center and iTunes/iTunes U ~ Stanford.

  • How to use Xcode Tools with a Command Line Project

    I'm using Xcode 3.2.6, C compiler.  I've had an application for years that is command-line on the terminal, compiling with a makefile.  Now I want to actually use the performance tools included with Xcode, such as threads, time profiler, etc.  How do I do this?
    I created a project for it (never did that before), added source files, etc -- it seems to work.  It created the application, which will run via the terminal like always.  But whenver I try to use Run (inside Xcode), a window opens up saying "Stop Executable".  I have to click OK and that's the end of it.  Nothing has happened.
    I found an old query on the web similar to this from 2008.  The suggestion was to open the console.  Still nothing.  "Sync with Debugger" does no good.  Please help!

    That I understood.  I did try Run > Console.  Nothing intelligible happened.  Then I synced with the debugger.  he program is called fer64.  I get this:
    No executable file specified.
    Use the "file" or "exec-file" command.
    No executable file specified.
    Use the "file" or "exec-file" command.
    The program being debugged is not being run.
    The program being debugged is not being run.
    Not executing.
    (gdb) r fer64
    Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Con tents/Resources/PBGDBIntrospectionSupport.A.dylib")
    Starting program:  fer64
    Not executing.

  • How to use Adobe LiveCycle Forms Standard / Pro to leverage features in Adobe Reader

    Can someone please tell me how to use the Adobe LiveCycle Forms Standard or Pro module to leverage features in Adobe Reader? Do you also need to have the Reader Extensions Module?
    The forms data sheet says that it is possible to leverage features in Adobe Reader but does not go on to detail how.

    Depends on your deployment pattern.  You can just use Reader Extensions if you're publishing forms on a site, if you need to prefill or perform other processing on the template then LiveCycle Forms is needed.  If you want to render to HTML5 for tablet support then Forms Pro is needed.

  • How to use parameter passed from standard page in VO query of custom page

    Hi everyone,
    I have a custom page which needs to be called from a standard page. Now this custom page is based on some parameters passed from standard page.
    How do I catch those parameters i my custom page .
    And how to use those parameters in the VO query of my custom page.
    Edited by: Bunny on Nov 11, 2010 9:16 AM

    Hi,
    Bunny wrote:
    I have a custom page which needs to be called from a standard page. Now this custom page is based on some parameters passed from standard page.
    How do I catch those parameters i my custom page .---If standard page the button style is :Button,Then u can set Destination URL in personalization.
    Destination UR:"OA.jsp?page=/xxx/oracle/apps/po/msg/webui/CustomUpdatePG&Flag=" +Value  ---Like u can pass params
    ---IF the button style is :Submitbutton ,Then u need to customization of the co.
    ---In co processFormReq call a cutom page like below.
    pageContext.setForwardURL("OA.jsp?page=/xxx/oracle/apps/po/msg/webui/customUpdatePG&Flag=" +Value, null, (byte)0, null, null, true, "N", (byte)0);
    ---In custom page co in processRequest u can get these value :String value=pageContext.getParameter("Flag");
    And how to use those parameters in the VO query of my custom page.---Get the vo and set where clause
    String where="valueAttr="+value;
    vo.setWhereClauseParams(null);
    vo.setWhereClause(where);
    vo.executeQuery();
    Regards
    Meher Irk
    Edited by: Meher Irk on Nov 11, 2010 11:53 PM

  • How to use external CSS for standard items ?

    Hi,
    I would like to use my external CSS style-sheet for the standard items I add to my portal page.
    I build an UI template with a CSS-link to my css style-sheet, and I used this UI template for my portal page. But it seems that items cannot use this UI template CSS reference.
    Is there a way to use external CSS on standard items (text, url,...) ?
    Thanks for your help,
    Best Regards,
    JC.AUDARD

    Easiest way I find to do it is to drop your css file in the portal/images folder. Make a hidden html portlet on your template and link to /images/mycss.css. You can then use it for many items such as text, links, html portlets, etc.

  • How to use a self compiling compiler in Java

    I'm creating a user-customizable calculator - a calculator where the user can create his/her own buttons while the calculator runs.
    What I need to know is how I can get the calculator to compile an instruction - i.e. what a new button does, and add it to itself.
    For example, and user would create a button that calculates (UK) V.A.T by writing y = (x*0.175)
    This instruction would then be compiled while the calculator was running and be added to the calculator.
    Thanks,
    Aled.

    You need to think about how the whole system is going to work - you need to know everything that the button will require, and then think about how to provide this information to the button.
    So, by the sounds of you need say a single button to press when you want to add a new button to the calculator. Associated with this have text fields that take the function for the calculator. I would specify that the function uses variables e.g. x and y as in function = x * y. Then your program could parse the input string describing the function, by recognising "*" to mean * in the Java code syntax and "/" to mean /. Then treat everything else as variables. Since you can filter out the other variables i.e. not the operators, you can then say associate an array to contain the values of these. Then when the user uses the button and specifies the input parameters and presses the button, you can update this array, and perform the calculation based upon these values.
    Hope this helps.
    My advice really is just to think about everything that a button that creates new function buttons is going to need.
    PS. Remember to repaint the GUI once update its Container. Swing does this automatically, but I always specify it explicitly anyway to be safe. You can use either repaint(), validate(), or revalidate().
    Goodluck mate!

  • How to use cutom smartform instead standard?

    Hi,
    we are under upgrade of SRM 4.0 to SRM 5.0..
    For email notification of bid invitaion and acution creation..standard smartforms is calling..
    If we want to use our custom smartform...wt is procedure..cany any one know please tell me....
    Thanks
    Venkatesh

    Hi
    <u>Please ensure, this Standard Smartform - <b>BBP_BIDINV_BID</b> gets called here.... Depending on your SRM System version </u>
    <b>Please try this Sample code.</b>
    method IF_EX_BBP_CHANGE_SF_BID~CHANGE_SMARTFORM .
    IF SMARTFORM = 'BBP_BIDINV_BID'. " Standard Smartform
    SMARTFORM = 'ZBBP_BIDINV_BID'. " Call your Customer Smart form
    endmethod.
    Hope this will definitely help.
    Regards
    - Atul

  • Where Can Learn How to use Xcode

    Hi,
    Im 13 and i have an idea for a social app. I have bought a mac and downloaded xcode5. i am using parse and it is helping alot. i was just wondering is there some way to learn the bacics and essentials of xcode so i know where i am going wrong etc Please Help!!!

    Apple has a great set of instructions in there developer portal at http://developer.apple.com

  • How to Use SDK compile all MXML file in project ?

    Who can teach me ? Plz
    1.How to Use Adobe SDK to compile all MXML file in project ?
    2.How to Use Ant to compile all MXML file in project ?
    Thanks everyone !!

    Thank you first!
    Yes,you are right,since I am new to illustrator,and I want to try to write a plugin,
    I have read the sdk doc and API and opened the sample in vs2010,but no idea about how to operate the pdf doc in illustrator with api.
    Hope more advise or any examples,thank a lot.

  • How to Use native keyword in java programming

    Hi ,
    I am using JDK 1.6.0_11 , and i was trying to create a java program using "native" keyword ,
    i got the sample code for the same from the site : - http://www.javaworld.com/javaworld/javatips/jw-javatip23.html
    But when i type this command " C:\javah -stubs Happy " following error occurs
    " Error: JNI does not require stubs, please refer to the JNI documentation. "
    then typed " c:\javah -jni Happy" without any error .
    After that i wrote a HappyImpl.c as mentioned in the above tutorial
    #include <StubPreamble.h> /* Standard native method stuff. */
    #include "Happy.h" /* Generated earlier. */
    #include &ltstdio.h> /* Standard C IO stuff. */
    void Happy_printText (struct HHappy *this)
    puts ("Happy New Year!!!");
    then it is not compling and error is
    "unable to open included file StubPreamble.h file
    unable to open included file Happy.h file "
    Please help me . i want to use native method , i did exactly the same in tutorial at above link.
    Thanks & Regards
    Mannat

    you do need to know how to use your C compiler... It quite clearly can't find those files which indicates that you didn't tell it where to find them.

  • How to use TARGET_OS_WIN32 properly?

    In my program, I've got a console clear screen command that's of course different between PC and Mac. So I've got this:
    #if TARGETOSWIN32
    system("cls");
    #else
    system("clear");
    #endif
    But the PC doesn't seem to recognize the macro - it just skips to the #else part. Is TARGETOSWIN32 predefined in a library somewhere, or do I need to define it? If it's predefined, what library do I need to include (or is there something else I need to do)? If I need to define it, how do I do that?
    Thanks.

    Ah, ok, so I could have used MSCVER instead, and that would have worked as well, as long as I compiled in VS? However, it wouldn't work for me, because I'm not compiling in VS - I'm compiling in an opensource IDE called DevC++ (I only have the educational version of VS which won't create an exe).
    When I compile on DevC++, the build works as it should on Windows (calling "cls" instead of "clear").
    Also, isn't Xcode based on GCC? I used Xcode to compile the code on the Mac, and it works fine (thus I'm assuming _WIN32 is not defined, because it's calling "clear", as it should on the Mac).

  • How to Assign Customized BADI to Standard T.Code  Example ME51N

    Dear all,
    It would be really appriciate if you provide me a solutions.
    I have Created Customized BADI using SE18,SE19. But I am not aware How to Use those BADI in Standard Transaction.
    Example : I have Created PR Related BADI (ZPURREQ_ACC_CHK). How to utilize this BADI In ME51N,ME52N.
    Please advice me.
    Thanks
    Best Regards,
    KSK

    I think what you need to do is find what exits or existing BAdIs are available for the transaction.  Then in the user exit you can call your customized code.  That way you avoid changing SAP's code for the transaction.  You can find BAdIs related to purchasing by going to transaction SPRO and then following this path:
    Materials Management -> Purchasing -> Business Add-Ins for Purchasing
    I hope this helps.
    - April King

Maybe you are looking for

  • Where can i find ram for 13" macbook pro mid 2009?

    I upgraded from 2G to 4G 2-3 years ago. Now I'd like to go to 8G, but Apple doesn't appear to be selling it anymore. Any suggestions for a reliable 3rd party solution? Here's a few specs of my Macbook Pro: MacBook Pro 13-inch, Mid 2009 Processor  2.2

  • Drill into a Dataset from a url

    Hello, I have a page which makes use of the tabbed panel spry widget. Within that I have a tab that uses a spry master detail widget with its content generated using xmldata. The first recordset fills this page. Now I want to get to this page and thi

  • CS3 and Office 2007 problem

    Issue: When logged in as a local user (no admin rights) Word 2007 will crash the whole computer when you type a key. The reason I am posting on Adobe forums is that this only happens when CS3 is installed as well on the same computer. Troubleshooting

  • Doc for 10g client silent installation

    any documentation for 10g client installation (silent -installation) Thanks Ramya

  • Dynamic Creation of Class Name

    I just want to create the class name on the fly. Look the example below. String className = "gui.Header"; className header = new className; Let's assume that there is a Header class somewhere. Is this possible? or is there a way to do this?