Thread: Problem compiling GMP code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    3

    Unhappy Problem compiling GMP code

    Hi all!

    As I said in a previous post, I'm working with HUGE numbers, and it was suggested to me to try GMP.

    I have installed it on /usr/local/gmp-4.1.4 (with "./configure" and then "make") as it was said to be de default location. The installing procedures seemed to be ok. The validation tests were fine too.

    So, I've wrote the following test.c file:

    Code:
    #include <stdio.h>
    #include <gmp.h>
    
    int main (){
    
    mpz_t i;
    
    return;
    }
    At first, I tried to compile with
    gcc -o test test.c -lgmp
    but I got a "gmp.h - File not found"

    Then, I tried
    gcc -o test test.c -I /usr/local/gmp-4.1.4 -lgmp
    and
    gcc -o test test.c -I /usr/local/gmp-4.1.4 -L /usr/local/gmp-4.1.4 -lgmp
    and
    gcc -o test test.c -I /usr/local/gmp-4.1.4/ -L /usr/local/gmp-4.1.4/lib -lgmp

    but for all of them I got a "cannot find -lgmp"

    As you can probably see, I'm not a C expert, so I would like to apologize if I am doing something obviously wrong. But the fact is that I am not able to simply compile that code...

    PLEASE, HELP!!!

    Thanks in advance,

    Bruno
    Last edited by Bruno Couto; 10-07-2005 at 07:17 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with compiling code in cygwin
    By firyace in forum C++ Programming
    Replies: 4
    Last Post: 06-01-2007, 08:16 AM
  2. code problem
    By maritos in forum C Programming
    Replies: 1
    Last Post: 11-27-2005, 05:22 PM
  3. problem with selection code
    By DavidP in forum Game Programming
    Replies: 1
    Last Post: 06-14-2004, 01:05 PM
  4. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  5. Help with code for simple Y2K problem
    By Mule in forum C++ Programming
    Replies: 3
    Last Post: 03-06-2003, 12:53 AM