title: Getting gmp libraries to
body: <p>I am having a problem getting a program to compile using:</p>
  
  <p>Latest Msys and MinGW installations
  Windows 7 Pro / Intel Core I5 / 8GB</p>
  
  <p>GMP 5.1.2 libraries
   - the header file is in C:\gmp\include
   - the .a and .la files are in C:\gmp\lib</p>
  
  <p>I originally posted this as an Eclipse question, but the silence has been deafening. I have since tried compiling using just gcc in msys, and I get the same problem. I compile using:</p>
  
  <p>g++ -I /c/gmp/include -O0 -g3 -Wall -c -fmessage-length=0 -o main.o ./main.cpp </p>
  
  <p>which appears to complete successfully. Then I link using:</p>
  
  <p>g++ -L /c/gmp/lib -o GMPDebug.exe main.o </p>
  
  <p>result: </p>
  
  <p>main.o: In function <code>main':
  C:\Users\Clay\workspace\GMPDebug\Debug/../main.cpp:22: undefined reference to</code>__gmpz_init_set_str'
  collect2.exe: error: ld returned 1 exit status</p>
  
  <p>The program is very very simple - just enough to get the libraries working:</p>
  
  <pre><code>#include &lt;getopt.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;sys/time.h&gt;
  #include &lt;time.h&gt;
  #include &lt;iostream&gt;
  #include &lt;gmpxx.h&gt;
  #include &lt;gmp.h&gt;
  
  using namespace std;
  
  int main ()
  {
      mpz_t p;
      mpz_init_set_str (p,"3",10); 
  
      return 0;
  }
  </code></pre>
  
  <p>All of the includes are because I pared this down from a larger program. Any idea how to fix this? </p>
  
  <p>Thanks!</p>