News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

GMP (GNU Multi-Precision library)

Started by ixfd64, March 11, 2008, 04:11:48 AM

Previous topic - Next topic

ixfd64

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.

MortenMacFly

Quote from: ixfd64 on March 11, 2008, 04:11:48 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

straka.milan

Quote from: ixfd64 on March 11, 2008, 04:11:48 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?

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'"