undefine referennce __gmpf_init...

In the MinGw shell, I ran the line "Mingw-get install gmp", and i not sure if this is already enough for the gmp installation. Then i write a simple code to test it out:

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <gmp.h>


using namespace std;

int main()
{
    mpf_t f;
    mpf_init(f);
    cout << "Hello world!" << endl;
    return 0;
}


I tried to run it on code block after copying gmp.h and gmpxx.h into codeblock/mingw/include folder and i get this error:
1
2
3
obj\Debug\main.o||In function `main':|
D:\Desktop\graph\code block\testing\testing.cpp\main.cpp|10|undefined reference to `_imp____gmpf_init'|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|


Then i try to compile it directly with mingw, and i get the same error at that line "mpf_init(f)".

I did read a previous post about this problem, its look like this problem is caused by the linking problems, but i don't understand how should i link them
i think i got the problem solved already(cuz i just can't link the libs like that without first install the library).
Topic archived. No new replies allowed.