title: Mixed C++ and Fortran Linking Issue
body: <p>I have done some searching online but I cannot find out how to compile a simple C++ and Fortran code from linux. I need to get complex with it, but I just need to know how to start with a simple example. </p>
  
  <p>My C++ code is this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  extern int Add( int *, int * );
  extern int Multiply( int *, int * );
  
  int main()
  {
      int a,b,c;  
      cout &lt;&lt; "Enter 2 values: ";
      cin &gt;&gt; a &gt;&gt; b;
  
      c = Add(&amp;a,&amp;b);
      cout &lt;&lt; a &lt;&lt; " + " &lt;&lt; b &lt;&lt; " = " &lt;&lt; c &lt;&lt; endl;
      c = Multiply(&amp;a,&amp;b);
      cout &lt;&lt; a &lt;&lt; " * " &lt;&lt; b &lt;&lt; " = " &lt;&lt; c &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>My Fortran Code is this:</p>
  
  <pre><code>integer function Add(a,b)
      integer a,b
      Add = a+b
      return
  end
  
  
  integer function Multiply(a,b)
      integer a,b
      Multiply = a*b
      return
  end
  </code></pre>
  
  <p>I am using <code>ifort</code> to compile my Fortran code and g++ for C++ code. I have tried this terminal command:</p>
  
  <pre><code>$ ifort -c Program.f90
  $ g++ -o Main.cpp Program.o
  </code></pre>
  
  <p>But the error I am getting says "linker input file unused because linking not done."
  I am not sure how to link the two together. If someone could please help me out I would greatly appreciate it!</p>
  
  <p>PS - I have tried adding <code>-lg2c</code> at the end of my compilation line, and it is not recognized.</p>