GMP Development Tidbits

Torbjorn Granlund tege at
Fri Nov 4 12:24:56 CET 2005

Joppe Bos <jwbos at> writes:

  Hi all,
  Recently I saw the GMP Development Tidbits page
  ( and since I really would
  like to try the new gcd code I tried to re-compile GMP.
  I changed my gmp-impl.h file and run the sed command on all the source and
  header files. Compiling with the new gcd files went ok without any errors,
  but when I link my program to GMP I get the following message:
  /usr/local/lib/ undefined reference to `UNLIKELY'
  /usr/local/lib/ undefined reference to
  /usr/local/lib/ undefined reference to `LIKELY'
  /usr/local/lib/ undefined reference to
  collect2: ld returned 1 exit status
  This are macros I had to put into gmp-impl.h file. Did I do something
  wrong? Has anybody else tried to compile GMP with the tidbits?
Sorry, I missed that.  To define these properly is non-trivial
and would require bits from several files.  Instead, please put
these definitions in gmp-impl.h:

#define LIKELY(cond)    (cond)
#define UNLIKELY(cond)  (cond)


More information about the gmp-discuss mailing list