Ask Your Question
1

How can GMP be built statically for MSVC (Windows)?

asked 2023-03-20 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-05-23 04:00:00 +0000

lalupa gravatar image

To build GMP statically for MSVC on Windows, follow these steps:

  1. Download the latest GMP source code from https://gmplib.org/.

  2. Extract the source code to a directory.

  3. Open a MSVC command prompt.

  4. Navigate to the directory where the GMP source code is located.

  5. Configure the GMP build by running the following commands:

    cd build
    ..\configure --disable-shared --enable-static --prefix=<install_directory>
    

    <install_directory> should be replaced with the directory where you want GMP to be installed.

  6. Build GMP by running the following command:

    nmake
    
  7. Install GMP by running the following command:

    nmake install
    

    This will install GMP into the specified directory.

  8. To use GMP in your MSVC project, add the GMP include directory to your project's include path, and link against the GMP static library (libgmp.lib) located in the <install_directory>\lib directory.

Note: Make sure to use a compatible version of MSVC with the version of GMP you are building. Also make sure to set the appropriate architecture (32-bit or 64-bit) in the MSVC command prompt before building.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-20 11:00:00 +0000

Seen: 22 times

Last updated: May 23 '22