I am trying to use GMP rather than NTL for my Extended Plugin, but am
having problems.
Right now I am using a packaged version of GMP 4.1.4 on my G4 iMac .
The make install (with --enable-cxx) of the latest 4.2.2 version
works fine on my G4 iMac. The compile of 4.2.2 on my Intel iMac
passes all the make check tests, but the static libraries are
unusable. Since the suitable packaged version of GMP 4.1.4 works fine
on my Intel imac, that's what I'm going with now.
I'm using Xcode 4.2.1 on my G4. And I'm using the libgmpxx libraries
which provide a C++ wrapper. Building a C++ tool using GMP has given
no problems. For example, here is a simple program:
#include <iostream>
#include <gmpxx.h>
#include <string>
using namespace std;
int main (int argc, char * const argv[])
{
mpz_class x;
string xString;
x = 1234;
xString = x.get_str(10); // the 10 means base=10. This calls the
function get_str of the mpz_class, the GMP integer class
cout << xString.c_str() << endl;
cout << x << endl;
return 0;
}
When built and run the Terminal output is:
1234
1234
as expected.
One problem arises when I choose Xcode's REALbasic Mach-O plugin. In
the interface file to REALbasic, the use of the GMP get_str function
gives a link error:
ld: Undefined symbols:
___gmp_get_memory_functions
/Users/bob/Documents/ProgrammingCocoa/Extended2 Plugin/build/
Extended2 Plugin.build/Development/Extended2 Plugin.build/Objects-
normal/ppc/Extended2 Plugin.o reference to undefined
___gmp_get_memory_functions
/usr/bin/libtool: internal link edit command failed
Linking works when I remove the get_str line.
Why do I have a link problem with the plugin, considering there is no
link problem with get_str with a command line program?
Bob
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>