I am trying to compile a simple C program using GCC with MPIR under MinGW on my Windows 7 machine. I installed MPIR successfully (I guess) with configure, make, make check and make install (did not use "sudo" - what is this?).
The program is called "mytest.cpp", sits in the top folder of MPIR, namely C:/MPIR/mpir-2.7.0/, where also "mpir.h" is sitting (is it "the" (correct one? are there several?) mpir.h?):
#include "mpir.h"
using namespace std;
int main ()
{
mpz_t z;
mpz_init(z);
return 0;
}
I tried compiling via
gcc mytest.c -o mytest -lmpir -I/C:/MPIR/mpir-2.7.0/
with the hope that GCC would then be able to locate mpir.h, "-lmpir" because a helpful developer told me to; but then it says:
"C:/mingw/ [...] /bin/ld.exe: cannot find -lmpir"
where "[...]" stands for some directory up-and-down-climbs inside the "minGW" directory. However, I am with the shell currently in the C:/MPIR/mpir-2.7.0/ directory.
What is wrong? How to make GCC find the mpir files? Should the compile option "-I" be spelled differently? I also heard about some "-L" option but could not find that anywhere. Thanks.