Web lists-archives.com

Re: [Mingw-users] troubles compiling the GNU GMP under MinWG

Dear Eli,

Many thanks for the hint.
Indeed, when I manually -lgmp then all works fine:
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge   factorize.c   -o factorize -lgmp

The -lgmp must be after the .c (or at the very end) but I did not manage to fix the Makefile accordingly. I'm not enough Makefile expert to get this fixed, and I leave to somebody else to fix that in the package.

Here's the stripped-down Makefile to be fixed:
CC = gcc
CFLAGS = -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge

Anyway, many thanks for your help!



-----Original Message-----
From: Eli Zaretskii [mailto:eliz@xxxxxxx] 
Sent: Monday, July 24, 2017 5:47 PM
To: Euchner, Martin <martin.euchner@xxxxxxx>
Cc: mingw-users@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Mingw-users] troubles compiling the GNU GMP under MinWG

> From: "Euchner, Martin" <martin.euchner@xxxxxxx>
> Date: Mon, 24 Jul 2017 15:20:32 +0000
> $ make factorize
> gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge    factorize.c   -o factorize
> C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x23): undefined reference to `__gmpz_powm'
> C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x33): undefined reference to `__gmpz_cmp_ui'

The GCC command line obviously lacks the reference to GMP library.  I would look at the Makefile which produced this command, probably some variable isn't set there correctly or has an empty value.

Did the library itself build successfully?

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MinGW-users mailing list

This list observes the Etiquette found at
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe