Update: Compiler issues with Eclipse CDT

Clay Codner claycodner at gmail.com
Sun Jun 30 06:13:38 CEST 2013


I have pared down my program to troubleshoot the issue I am having. The
program is:

#include <getopt.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <iostream>
#include <gmpxx.h>
#include <gmp.h>

using namespace std;

int main ()
{
mpz_t p;
mpz_init_set_str (p,"3",10);

return 0;
}

Eclipse IDE for C/C++ Developers - 64 bit Version: Juno Service Release 2
Build id: 20130225-0426

Windows 7 Pro / Intel Core I5 / 8GB

GMP 5.1.2

MinGW & msys latest versions (compiled with Gcc 4.7.2)

Now when I build my project, I get this error:

20:17:55 *** Rebuild of configuration Debug for project GMPDebug *** Info:
Internal Builder is used for build g++ "-IC:\include" "-IC:\gmp-5.1.2" -O0
-g3 -Wall -c -fmessage-length=0 -o main.o "..\main.cpp" g++ "-LC:\include"
"-LC:\gmp-5.1.2" -o GMPDebug.exe main.o main.o: In function main':
C:\Users\Clay\workspace\GMPDebug\Debug/../main.cpp:22: undefined reference
to__gmpz_init_set_str' collect2.exe: error: ld returned 1 exit status

The problem tab still has a bunch of errors such as:

Description Resource Path Location Type bad register name `%g2' mul_1.asm
/GMPTest/gmp-5.1.2/mpn/sparc64/ultrasparc1234 line 99 C/C++ Problem

...which is interesting since I'm not on a sparc.

I have done a search for "gmpz" in the install directories and found
nothing. I didn't necessarily expect to, but it was worth a shot. I get
similar errors if I replace mpz_init_set_str with mpz_init_set_ui.


Thanks!!


More information about the gmp-discuss mailing list