Whitequill Riclo wrote:
> On Wed, Sep 19, 2012 at 9:11 PM, Bruce Dubbs <bruce.du...@gmail.com> wrote:

>>> I've already succeeded at building gmp, and mpc with in the gcc build
>>> directory, I need to make mpfr, what do you suggest I do?
>>>
>>> Is there a way to just build the following code block;
>>
>> Needs #include <mpfr.h>
>>
>>>      1. | int
>>>      2. | main ()
>>>      3. | {
>>>      4. | mpfr_t x;  mpfr_init(x) ; mpfr_clear(x);
>>>      5. |
>>>      6. |   ;
>>>      7. |   return 0;
>>>      8. | }
>>>
>>> and then re-run make?
>>
>> After lfs is completed, there are the files /usr/lib/libmpfr.{a,so).
>> How about:
>>
>> gcc -o xyz xyz.c -lmpfr
>>
>> Works for me.
>>
>> $ ldd xyz
>>           linux-gate.so.1 (0xffffe000)
>>           libmpfr.so.4 => /usr/lib/libmpfr.so.4 (0xb7735000)
>>           libc.so.6 => /lib/libc.so.6 (0xb7584000)
>>           libgmp.so.10 => /usr/lib/libgmp.so.10 (0xb751f000)
>>           /lib/ld-linux.so.2 (0xb77a7000)

>> I think I know what I'm doing wrong finally, all the command flags I'm
>> using to find mpfr are to find the mpfr library/header file, rather then
>> find the source to build the library.
>>
> What is the appropriate flag to tell gcc the source path rather then the
> library path?

Where are the files?  The headers should be in /usr/include and the 
libraries in /usr/lib.  Both of those are searched by default/

You specify header paths with -I /path/to/header and library paths with 
-L /path/to library.

The other posts that mention LDFLAGS, CFLAGS, or CPPFLAGS are incorrect. 
  Those are defined by configure and make, but are not used explicitly 
by gcc.  The variables CPATH, C_INCLUDE_PATH, and  LIBRARY_PATH are used 
directly by gcc.

   -- Bruce


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to