title: How do I add a call to FORTRAN code to a project in Xcode 4.5?
body: <p>My company has a bunch of Fortran code. Traditionally, we compiled the code we needed into a .dll and called that .dll when we needed a calculation done. We are now trying to create an iPad app, which unfortunately means we can't just call a .dll anymore. </p>
  
  <p>One of my coworkers have managed to make a simple Command Line Tool project, where we call a Fortran file to write "Hello, World" in the debugger.  However, when I try to get it to work on view based iPad app, I get a bunch of linker errors saying the symbols I'm using cannot be found.  I know that the Command Line Tool uses a .cpp file to actually run the Fortran, and I've seen many threads concerning calling .cpp files in an app, but all the ones I've seen are outdated, directly contradict each other, and their fixes don't work for me.</p>
  
  <p>My question is, <strong>is there a more direct way to call Fortran straight from a .m file?</strong>  If not, <strong>what do I have to do to take the working Command Line Tool and get it into an app?</strong></p>
  
  <p>UPDATE 1: following the tutorials posted in the comments, I have been able to create a .o file from my Fortran code.  I can do a File-Add Files to add it in easily enough, but now how do I actually call it?</p>
  
  <p>UPDATE 2: Okay, baby steps.  I found out you can make a .a static library (I'll call it "new_library") from .o files ("source_file.o") using the Terminal command <code>ar crv new_library.a source_file.o</code> (you can do it for multiple .o files by just adding <code>source_file2.o source_file3.o</code> for as many .o files as you want - NOTE: make sure you use <code>cd</code> to get to the folder where the .o files are located).  I'm pretty sure Xcode will work with .a files, but it seems a .h file is still needed to let the other files in the project (like the view controllers) make calls to what's in the .a file. I know I can make a new .a file from Xcode itself (New Project -> iOS -> Framework &amp; Library -> Cocoa Touch Static Library), but when I've done it that way in the past, I just write normal .m and .h files, and when I build the new library it just mashes all the .m files into 1 .a.  When I want to use the code in that .a in another project, I just import the .a and all the .h files into the new project, and I can call the methods in the .a file just as if I had imported all the separate .m files.  So the next question is, <strong>do I still need a .h when my .a is made with the terminal instead of Xcode?</strong>  If so, <strong>how would I make a Fortran header file?</strong>  If not, <strong>how do I call my Fortran code in the .a?</strong></p>