Good day,
I have written some new functions, called fmpz_mod_mpoly_q_... creating header 'fmpz_mod_mpoly_q.h' for them and an appropriate folder. But after installing flint with those added functions, I still cannot run an example file that uses them.
The ubuntu command line I run is:
gcc fmpz_mod_mpoly_q.c -lflint
Where 'fmpz_mod_mpoly_q.c' is just an example program that imports and uses those newly added functions. The line that does that looks like following:
#include <flint/fmpz_mod_mpoly_q.h>
The error message I get it following:
fmpz_mod_mpoly_q.c: In function ‘main’:
fmpz_mod_mpoly_q.c:41:5: warning: implicit declaration of function ‘fmpz_mod_mpoly_q_mul’; did you mean ‘fmpz_mod_mpoly_mul’? [-Wimplicit-function-declaration]
41 | fmpz_mod_mpoly_q_mul(x, x, y, ctx);
| ^~~~~~~~~~~~~~~~~~~~
| fmpz_mod_mpoly_mul
fmpz_mod_mpoly_q.c:45:5: warning: implicit declaration of function ‘fmpz_mod_mpoly_q_clear’; did you mean ‘fmpz_mod_mpoly_clear’? [-Wimplicit-function-declaration]
45 | fmpz_mod_mpoly_q_clear(x, ctx);
| ^~~~~~~~~~~~~~~~~~~~~~
| fmpz_mod_mpoly_clear
/usr/bin/ld: /tmp/cccnSF1q.o: in function `main':
fmpz_mod_mpoly_q.c:(.text+0x113): undefined reference to `fmpz_mod_mpoly_q_init'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x12c): undefined reference to `fmpz_mod_mpoly_q_init'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x150): undefined reference to `fmpz_mod_mpoly_q_set_str_pretty'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x170): undefined reference to `fmpz_mod_mpoly_q_print_pretty'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x1a8): undefined reference to `fmpz_mod_mpoly_q_set_str_pretty'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x1d1): undefined reference to `fmpz_mod_mpoly_q_mul'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x1f1): undefined reference to `fmpz_mod_mpoly_q_get_str_pretty'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x234): undefined reference to `fmpz_mod_mpoly_q_clear'
/usr/bin/ld: fmpz_mod_mpoly_q.c:(.text+0x252): undefined reference to `fmpz_mod_mpoly_q_clear'
collect2: error: ld returned 1 exit status
The error only concerns my newly added functions, all the original ones like
'fmpz_clear' or 'flint_printf' are imported and compiled just fine.
So, are there any extra steps I am missing when adding new functions to flint or what could be a problem?
Thanks in advance!
Cheers,
Andrii Yanovets