Reputation: 3593
I have a makefile for use with some programs using the zkcm-library, including the following object line:
zkcm_c.o: zkcm_c.cpp zkcm_c.h config.h
g++ -c zkcm_c.cpp -lgmp -lgmpxx -lmpfr
The compiler complains that there is an "undefined reference to '_imp_mpfr__inits2' " and the same for every use of mpfr-functions. The strange thing is, there are other objects in the makefile that uses mpfr-functions with no problem, e.g. the main program (first line):
SpMC: SpMC.cpp MCutility.h HPutility.h wfs.h MC_funcs.h $(ZKCMOBJECTS) $(ZKCMHFILES)
g++ SpMC.cpp -lgmp -lmpfr -lmpc -o SpMC $(ZKCMOBJECTS)
In both cases I have #include<mpfr.h>
in the source and as you see link to it using -lmpfr
. Any ideas why this works for SpMC.cpp but not zkcm_c.cpp?
Upvotes: 1
Views: 150