Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:20:55+00:00 2026-05-22T21:20:55+00:00

I installed the gmp libraries in cygwin via its installer. I tried to compile

  • 0

I installed the gmp libraries in cygwin via its installer. I tried to compile a simple program with gcc.

#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>


int
main(void)
{
    mpz_t test;
    int i;

    printf("enter number\n");
    gmp_scanf("%Z",&test);
    gmp_printf("test=%Z",test);
    i=mpz_probab_prime_p(test,5);
    if(i)
        printf("prime\n");
    else
        printf("not prime\n");
    return 0;
}

But I got this:

 /cygdrive/c/Users/xxxxx/Documents/NetBeansProjects/rsa_system/main.c:13: undefined reference to  `__imp____gmp_scanf'

This is the first time that I try to use a non-standard library and I’m getting confused here. My compiler is set to Cygwin and I’ve done all the installation part. Any ideas on what may be wrong? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:20:56+00:00Added an answer on May 22, 2026 at 9:20 pm

    Are you asking gcc to link GMP?

    i.e.: gcc -lgmp main.c ....

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed GCC 4.7.2 and GMP 5.1.0 and I've written this simple code
Installed rubyinstaller-1.8.7-p358.exe, then tried to install jammit , but the config.gem command isn't being
I tried to install gcc 4.5 on ubuntu 10.04 but failed. Here is a
I installed DiffMerge in Applications folder. I can't get DiffMerge run on its own,
I am trying to compile gcc version gcc4.3.2 using gcc version 4.1.2 20080704 (Red
System Info: Mac OS x 10.7 CGAL installed in: CGAL INCLUDES are in /opt/local/include/CGAL/
I need to use GMP in an iphone program I'm working on, but don't
Just trying to compile some trivial Haskell, but its not finding the c runtimes,
Installed Thinking Sphinx via Gemfile: gem 'thinking-sphinx',:git => 'git://github.com/freelancing-god/thinking-sphinx.git' When I run rake thinking_sphinx:configure
I downloaded gcc 4.6.2 (with GMP, MPFR, and MPC) and did a build. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.