Author Topic: GMP (GNU Multi-Precision library)  (Read 6328 times)

Offline ixfd64

  • Multiple posting newcomer
  • *
  • Posts: 26
    • Facebook
GMP (GNU Multi-Precision library)
« on: March 11, 2008, 04:11:48 am »
I am planning to do some programming with the GMP library. I know that GMP was originally made for Linux, so I downloaded the Windows port.

I compiled the sources on Cygwin and got a file called libgmp.a, which seems to be the library file. Does anyone know where I should place libgmp.a and gmp.h (the header file) for it to work with Code::Blocks?

Thanks in advance.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: GMP (GNU Multi-Precision library)
« Reply #1 on: March 11, 2008, 09:16:16 am »
I compiled the sources on Cygwin and got a file called libgmp.a, which seems to be the library file. Does anyone know where I should place libgmp.a and gmp.h (the header file) for it to work with Code::Blocks?
Leave them where they are and setup your project accordingly (search directories for the compiler/linker and librar{y/ies} for the linker).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline straka.milan

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: GMP (GNU Multi-Precision library)
« Reply #2 on: March 11, 2008, 09:59:54 pm »
I compiled the sources on Cygwin and got a file called libgmp.a, which seems to be the library file. Does anyone know where I should place libgmp.a and gmp.h (the header file) for it to work with Code::Blocks?

Or you can put them in the include and lib directories of the compiler you are using.

I.e. if you use Codeblocks 8.02 with mingw bundled and you installed it to C:\Program files\Codeblocks,
than put libgmp.a to C:\Program files\Codeblocks\Mingw\lib and gmp.h to C:\Program files\Codeblocks\Mingw\include.

This way all projects can use gmp, just #include <gmp.h> at the beginning and add
library gmp in the linker section of the project configuration.
Q='Q=%s;printf "$Q" "\x27$Q\x27"';printf "$Q" "'$Q'"