Professional Web Applications Themes

problem with GCC search path on FreeBSD5.3 AMD64 - FreeBSD

> this isn't a gcc problem. Hm, maybe I used the wrong terms to define the situation. I agree that its not gcc's fault, its some kind of (mis)configuration issue. > ldconfig I used ldconfig to generete te hints file, and then when I do a "ldconfig -r" all the libs I need appears there... the strange thing is that if I try to include them in my own programs it doesnt work. Im using the CFLAGS="-B /usr/local/lib -L/usr/local/include" as a workaround, but im searching for a more elegant way to solve this issue....

  1. #1

    Default Re: problem with GCC search path on FreeBSD5.3 AMD64

    > this isn't a gcc problem.
    Hm, maybe I used the wrong terms to define the situation. I agree that
    its not gcc's fault, its some kind of (mis)configuration issue.
    > ldconfig
    I used ldconfig to generete te hints file, and then when I do a
    "ldconfig -r" all the libs I need appears there... the strange thing
    is that if I try to include them in my own programs it doesnt work.

    Im using the CFLAGS="-B /usr/local/lib -L/usr/local/include" as a
    workaround, but im searching for a more elegant way to solve this
    issue.
    Maicon Stihler Guest

  2. #2

    Default Re: problem with GCC search path on FreeBSD5.3 AMD64

    On Tue, Feb 15, 2005 at 03:55:00PM -0300, Maicon Stihler wrote:
    > > this isn't a gcc problem.
    > Hm, maybe I used the wrong terms to define the situation. I agree that
    > its not gcc's fault, its some kind of (mis)configuration issue.
    Didn't you ask this question a few weeks ago? I certainly answered it
    then.
    > > ldconfig
    >
    > I used ldconfig to generete te hints file, and then when I do a
    > "ldconfig -r" all the libs I need appears there... the strange thing
    > is that if I try to include them in my own programs it doesnt work.
    ldconfig is for the runtime linker, it's not used by gcc when linking
    object files.
    > Im using the CFLAGS="-B /usr/local/lib -L/usr/local/include" as a
    > workaround, but im searching for a more elegant way to solve this
    > issue.
    Those flags look completely wrong. You want "-L /usr/local/lib -I
    /usr/local/include" - either in CFLAGS, or otherwise passed into your
    gcc commandline.

    This is the correct way to address the issue.

    Kris

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQFCEmoJWry0BWjoQKURAnubAKC79tFk4v8i+UxujDBh30 rRz/SGhACeItpD
    MR9s3YIIu/nF7WUbIQxfw1M=
    =Fu71
    -----END PGP SIGNATURE-----

    Kris Kennaway Guest

  3. #3

    Default RE: problem with GCC search path on FreeBSD5.3 AMD64


    > -----Original Message-----
    > From: [email]owner-freebsd-questionsfreebsd.org[/email]
    > [mailto:owner-freebsd-questionsfreebsd.org]On Behalf Of Kris Kennaway
    > Sent: Tuesday, February 15, 2005 1:31 PM
    > To: Maicon Stihler
    > Cc: [email]freebsd-questionsfreebsd.org[/email]; Ted Mittelstaedt
    > Subject: Re: problem with GCC search path on FreeBSD5.3 AMD64
    >
    >
    > On Tue, Feb 15, 2005 at 03:55:00PM -0300, Maicon Stihler wrote:
    > > > this isn't a gcc problem.
    > > Hm, maybe I used the wrong terms to define the situation. I
    > agree that
    > > its not gcc's fault, its some kind of (mis)configuration issue.
    >
    > Didn't you ask this question a few weeks ago? I certainly answered it
    > then.
    >
    > > > ldconfig
    > >
    > > I used ldconfig to generete te hints file, and then when I do a
    > > "ldconfig -r" all the libs I need appears there... the strange thing
    > > is that if I try to include them in my own programs it doesnt work.
    >
    > ldconfig is for the runtime linker, it's not used by gcc when linking
    > object files.
    >
    > > Im using the CFLAGS="-B /usr/local/lib -L/usr/local/include" as a
    > > workaround, but im searching for a more elegant way to solve this
    > > issue.
    >
    > Those flags look completely wrong. You want "-L /usr/local/lib -I
    > /usr/local/include" - either in CFLAGS, or otherwise passed into your
    > gcc commandline.
    >
    > This is the correct way to address the issue.
    >
    Kris, a lot of systems don't like the spaces, the more portable way
    to set those flags should be:

    "-L/usr/local/lib -I/usr/local/include"

    And this only sets it up for linking the binary, not runtime linking.
    He still needs to specify either "-R/usr/local/lib" to the linker
    (ld,) to get a binary that finds it's libraries, or use one of
    the other tricks (ldconfig, softlinks, etc.)

    gcc -B/usr/local/lib as near as I can tell makes gcc look for the
    linker in /usr/local/lib which as you observe is completely wrong.

    Ted

    Ted Mittelstaedt Guest

Similar Threads

  1. Replies: 0
    Last Post: November 14th, 11:39 AM
  2. HARP in FreeBSD5.3
    By David Puerta in forum FreeBSD
    Replies: 0
    Last Post: February 22nd, 10:00 AM
  3. PEAR Search Path (PHP's include_path)
    By doyou@g0t-root.com in forum FreeBSD
    Replies: 1
    Last Post: February 21st, 12:06 AM
  4. Change search path.
    By Kevin Burton in forum ASP.NET Web Services
    Replies: 1
    Last Post: November 15th, 11:09 PM
  5. assembly search path
    By Steve C. Orr, MCSD in forum ASP.NET General
    Replies: 1
    Last Post: August 7th, 10:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139