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 9282477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:23:09+00:00 2026-06-18T18:23:09+00:00

I’m trying to compile a C program (gfp2.c) that uses many functions from the

  • 0

I’m trying to compile a C program (gfp2.c) that uses many functions from the GMP library. I downloaded and installed the GMP library using the normal configure, make and install sequence. I also ran make check before the install and there were no errors.

I am using GMP 5.1.1, GCC 4.2.1 and MAC OS 10.8.2.

I first type gcc gfp2.c -lgmp to link the library and then tried gcc gfp2.c and get the following output on the terminal:

1407-wn-172-21-30-223:pqcrypto11_scripts dfish$ gcc gfp2.c -lgmp 

v1407-wn-172-21-30-223:pqcrypto11_scripts dfish$ gcc gfp2.c

Undefined symbols for architecture x86_64:

  "___gmp_printf", referenced from:
      _print_GF in ccrft0vq.o

  "___gmp_randinit_default", referenced from:
      _setup_GF in ccrft0vq.o

  "___gmp_sprintf", referenced from:
      _get_GF in ccrft0vq.o

  "___gmpz_add", referenced from:
      _add_GF in ccrft0vq.o
      _mul_GF in ccrft0vq.o
      _sqr_GF in ccrft0vq.o

  "___gmpz_add_ui", referenced from:
      _add_GF_ui in ccrft0vq.o

  "___gmpz_addmul", referenced from:
      _inv_GF in ccrft0vq.o

  "___gmpz_clear", referenced from:
      _clear_GF in ccrft0vq.o
      _setup_GF in ccrft0vq.o
      _free_GF in ccrft0vq.o

  "___gmpz_cmp", referenced from:
      _cmp_GF in ccrft0vq.o

  "___gmpz_cmp_ui", referenced from:
      _is_one_GF in ccrft0vq.o

  "___gmpz_fdiv_ui", referenced from:
      _setup_GF in ccrft0vq.o

  "___gmpz_init", referenced from:
      _init_GF in ccrft0vq.o
      _setup_GF in ccrft0vq.o

  "___gmpz_init_set_str", referenced from:
      _setup_GF in ccrft0vq.o

  "___gmpz_init_set_ui", referenced from:
      _setup_GF in ccrft0vq.o

  "___gmpz_invert", referenced from:
      _inv_GF in ccrft0vq.o
      _a24 in ccrft0vq.o

  "___gmpz_mod", referenced from:
      _add_GF in ccrft0vq.o
      _add_GF_ui in ccrft0vq.o
      _sub_GF in ccrft0vq.o
      _sub_GF_ui in ccrft0vq.o
      _scalar_GF in ccrft0vq.o
      _scalar_GF_si in ccrft0vq.o
      _mul_GF in ccrft0vq.o
      ...

  "___gmpz_mul", referenced from:
      _scalar_GF in ccrft0vq.o
      _mul_GF in ccrft0vq.o
      _sqr_GF in ccrft0vq.o
      _inv_GF in ccrft0vq.o

  "___gmpz_mul_2exp", referenced from:
      _setup_GF in ccrft0vq.o

  "___gmpz_mul_si", referenced from:
      _scalar_GF_si in ccrft0vq.o

  "___gmpz_neg", referenced from:
      _inv_GF in ccrft0vq.o

  "___gmpz_pow_ui", referenced from:
      _setup_GF in ccrft0vq.o

  "___gmpz_set", referenced from:
      _copy_GF in ccrft0vq.o
      _add_GF_ui in ccrft0vq.o
      _sub_GF_ui in ccrft0vq.o
      _neg_GF in ccrft0vq.o

  "___gmpz_set_str", referenced from:
      _set_GF in ccrft0vq.o

  "___gmpz_set_ui", referenced from:
      _shamir in ccrft0vq.o
      _a24 in ccrft0vq.o

  "___gmpz_sizeinbase", referenced from:
      _mont_3ladder in ccrft0vq.o
      _shamir in ccrft0vq.o

  "___gmpz_sub", referenced from:
      _sub_GF in ccrft0vq.o
      _neg_GF in ccrft0vq.o
      _mul_GF in ccrft0vq.o
      _sqr_GF in ccrft0vq.o

  "___gmpz_sub_ui", referenced from:
      _setup_GF in ccrft0vq.o
      _sub_GF_ui in ccrft0vq.o

  "___gmpz_tstbit", referenced from:
      _mont_3ladder in ccrft0vq.o
      _shamir in ccrft0vq.o

  "___gmpz_urandomm", referenced from:
      _random_GF in ccrft0vq.o

ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

I’m pretty new to C programming and using libraries, etc. and really do not know what I’m doing so any help is appreciated. Thanks!

  • 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-06-18T18:23:11+00:00Added an answer on June 18, 2026 at 6:23 pm

    Your first attempt has already done the compilation and the linking. You don’t need to do the second step. If you check your directory you’ll find a file called a.out that is the executable you need.

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

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.