GMP on MacOS

Minh Nguyen md6nguyen@yahoo.com
Fri, 6 Dec 2002 11:00:05 -0800 (PST)


--0-1819704317-1039201205=:31765
Content-Type: text/plain; charset=us-ascii


Hi all, I'm building GMP shared library on MacOS. Everything worked fine. Here is the library listing

#### SNIP ####

rhea 11% ls -l $HOME/gmp-4.1/.libs

-rwxr-xr-x 1 mnguyen maple 1372168 Dec 5 14:54 libgmp.3.3.0.dylib*

lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.3.dylib@ -> libgmp.3.3.0.dylib

lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.dylib@ -> libgmp.3.3.0.dylib

#### SNIP #### 

I then set the Dynamic Library Path to include the GMP path

rhea 12 % set DYLD_LIBRARY_PATH="$HOME/gmp-4.1/.libs"

Next, I compile a test program 

rhea 14 % gcc -g -I $HOME/gmp-4.1/ -o add_test add_test.c -L$HOME/gmp-4.1/.libs -lgmp

The test program was compiled fine. However, when I tried to run the program I got this error. 

#### SNIP #### 

rhea 15 % ./add_test 100

dyld: ./add_test can't open library: /usr/local/lib/libgmp.3.dylib (No such file or directory, errno = 2)

#### SNIP ####

It looks like that the path "/usr/local/lib/libgmp.3.dylib" was embedded in the shared library libgmp.3.3.0.dylib. But why the error message? After all, libgmp.3.dylib is just a symbolic link to libgmp.3.3.0.dylib right? So why bother to find this link when the shared library has been found. Anyone knows how to get around this?

Thanks, 

Minh

 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--0-1819704317-1039201205=:31765
Content-Type: text/html; charset=us-ascii

<FONT size=2>
<P>Hi all, I'm building GMP shared library on MacOS. Everything worked fine. Here is the library listing</P>
<P>#### SNIP ####</P>
<P>rhea 11% ls -l $HOME/gmp-4.1/.libs</P>
<P>-rwxr-xr-x 1 mnguyen maple 1372168 Dec 5 14:54 libgmp.3.3.0.dylib*</P>
<P>lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.3.dylib@ -&gt; libgmp.3.3.0.dylib</P>
<P>lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.dylib@ -&gt; libgmp.3.3.0.dylib</P>
<P>#### SNIP #### </P>
<P>I then set the Dynamic Library Path to include the GMP path</P>
<P>rhea 12 % set DYLD_LIBRARY_PATH="$HOME/gmp-4.1/.libs"</P>
<P>Next, I compile a test program </P>
<P>rhea 14 % gcc -g -I $HOME/gmp-4.1/ -o add_test add_test.c -L$HOME/gmp-4.1/.libs -lgmp</P>
<P>The test program was compiled fine. However, when I tried to run the program I got this error. </P>
<P>#### SNIP #### </P>
<P>rhea 15 % ./add_test 100</P>
<P>dyld: ./add_test can't open library: /usr/local/lib/libgmp.3.dylib (No such file or directory, errno = 2)</P>
<P>#### SNIP ####</P>
<P>It looks like that the path "/usr/local/lib/libgmp.3.dylib" was embedded in the shared library libgmp.3.3.0.dylib. But why the error message? After all, libgmp.3.dylib is just a symbolic link to libgmp.3.3.0.dylib right? So why bother to find this link when the shared library has been found. Anyone knows how to get around this?</P>
<P>Thanks, </P>
<P>Minh</P>
<P>&nbsp;</P></FONT><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Yahoo! Mail Plus</a> - Powerful. Affordable. <a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Sign up now</a>
--0-1819704317-1039201205=:31765--