2

I'm trying to compile this simple FLINT program:

#include "flint/arb.h"

int main()
{
    arb_t x;
    arb_init(x);
    arb_const_pi(x, 50 * 3.33);
    arb_printn(x, 50, 0); flint_printf("\n");
    flint_printf("Computed with FLINT-%s\n", flint_version);
    arb_clear(x);
}

Following https://www.flintlib.org/doc/building.html, I installed it via MSYS. Apparently there are with detecting arb.h, when I try to run the program, I get the following errors:

flint.c:1:10: fatal error: flint/arb.h: No such file or directory

The following command is used to run the program:

gcc flint.c -lflint -lgmp -lmpfr

I tried different combinations of this command, according to link, I can provide flags such as: -I/path/to/flint -L/path/to/flint, if the FLINT header and library files are not in a standard location such as /usr/local, in my case path to arb.h is "C:\msys64\usr\local\include". If i do it, file is visible, but there are many errors like C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/. ./../../../x86_64-w64-mingw32/bin/ld.exe: C:\...\ccv8aaRi.o:flint.c:(.text+ 0xd5): undefined reference to arb_fprintn', even though the functions like "arb_fprintn" are defined in arb.h.

UPD

It turns out that I had the arb.h file from another library,and there is no flie arb.h in flint itself for some reason. I'm wondering if anyone else has had this problem and what should be done? The code I'm trying to compile is listed as an example on the (https://www.flintlib.org/doc/building.html)

  • 1
    It does sound like it might be worth adding `-IC:\msys64\usr\local\include` to your compiler options. – pmacfarlane May 14 '23 at 18:09
  • Yes, I did that, after adding the flag the file is visible (the program starts), but there are many errors like `C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/. ./../../../x86_64-w64-mingw32/bin/ld.exe: C:\...\ccv8aaRi.o:flint.c:(.text+ 0xd5): undefined reference to `arb_fprintn'`, even though the function "arb_fprintn" is defined in file arb.h. – Emma Anderson May 15 '23 at 23:57
  • 2
    Your program does not start. It still fails to link. You still need to add a `-L` option for where your library is. It might be in `/usr/local/lib". `arb_fprintn` is not defined in `arb.h`. It's declared there, but a library somewhere else defines it. – pmacfarlane May 16 '23 at 00:12

0 Answers0