undefined reference to `operator<<(std::ostream&, __mpz_struct const*)'

444 views
Skip to first unread message

Justin Becker

unread,
Aug 13, 2013, 12:57:52 AM8/13/13
to mpir-...@googlegroups.com
I am not certain if this is quite the appropriate place to be asking for help, so if I am not welcome here for this purpose do not hesitate to show me the door. However, if you could be so kind as too give an aspiring developer a helping hand I would be more than gracious. I recently built mpir 2.6.0 in VC++ using instructions found here: http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/ yielding me this list of files: mpir.lib, mpir.h, mpirxx.lib and mpirxx.h. I am using code:blocks on windows and wish to be able to utilize these in my software but, all builds fail with the error given above at line 2166 in mpirxx.h. As far as I am aware I followed all linking instructions correctly and yet my project fails to build. This is the build command I have been running "mingw32-g++.exe -Ldepend\Mpir -o bin\Debug\MandelBrot.exe obj\Debug\EasyBMP.o obj\Debug\main.o depend\Mpir\mpir.lib depend\Mpir\mpirxx.lib"

Others on the internet have said in regards to a similar error in your sister library GMP that you must use the linker setting -lgmp -lgmpxx. When attempted these both failed citing that "-lgmp cannot be found". Is there a linker setting I am missing here?

Thank you for your time,

Justin Becker

Brian Gladman

unread,
Aug 13, 2013, 4:19:45 AM8/13/13
to mpir-...@googlegroups.com
On 13/08/2013 05:57, Justin Becker wrote:

...GMP that you must use the linker setting -lgmp -lgmpxx.

As you know, the mpir libraries are named mpir.lib and mpirxx.lib, not
gmp.lib and gmpxx.lib, so you would have to use "-lmpir -lmpirxx" for
MPIR.

You might or might not have to add the 'lib' extension on these names -
I don't know as I don't use mingw etc.

Good luck.

Brian

Reply all
Reply to author
Forward
0 new messages