title: odd compilation error c++ "undefined reference" & "relocation truncated"
body: <p>here is my code it is very simple in the end all it is going to do is prompt the user to input the size of  two 2d arrays and then input the entries and multiple the result as if they were mathmatical matrix. the program is far from done but i like to compile thesesmall programs as i go to see if the all parts are working. when i compile this code i get this odd error. note i am very much a beginner when i comes to C++ as well as coding in general. </p>
  
  <pre><code>$ g++ matrix.C -omatrixs -lm
  /tmp/ccUDYTb1.o:matrix.C:(.text+0x266): undefined reference to `Matrixsettings(int, int, int, int)'
  /tmp/ccUDYTb1.o:matrix.C:(.text+0x266): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Matrixsettings(int, int, int, int)'
  /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccUDYTb1.o: bad reloc address 0x1c in section `.xdata'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>i am using cygwin 64bit with a gnu compiler and notepad++ to compile and write this.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  using namespace std;
  //Prototypes
  double Matrixsettings(int, int, int, int);
  
  int main()
  {
      int a=2, b=2, c=2, d=2;
      int m1 [a] [b], m2 [c] [d];
      cout&lt;&lt;  Matrixsettings( a,b,c,d);
      cout&lt;&lt; a&lt;&lt;b&lt;&lt;c&lt;&lt;d;
  return 0;
  }
  
  double Matrixsettings( int &amp;a, int &amp;b,  int &amp;c, int &amp;d)
  { 
  cout&lt;&lt; "how many rows in the first matrix: ";
  cin&gt;&gt; a;
  cout&lt;&lt; "how many columns in the first matrix: ";
  cin&gt;&gt; b;
  cout&lt;&lt; "how many rows in the second matrix: ";
  cin&gt;&gt; c;
  cout&lt;&lt; "how many columns in the second matrix: ";
  cin&gt;&gt; d;
  return 0;
  }
  </code></pre>