Results 1 to 4 of 4

Thread: ld linker problem, PATH variable

  1. #1
    Join Date
    Apr 2013
    Beans
    4

    ld linker problem, PATH variable

    When I try to link C++ code (with either g++ or gcc) using sudo make install, for some reason I keep getting the following error:

    /usr/local/bin/ld: this linker was not configured to use sysroots

    One obvious problem is that my PATH variable keeps getting reset to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gamesand I don't know how to permanently reset it (where does the terminal read this information?), but even when resetting PATH to /usr/sbin:/usr/bin:/sbin:/bin:/usr/games the linker error persists - the linker is being found in /usr/local/bin instead of /usr/bin, and I don't know how to change it back (and restore it to defaults).

    Any advice?

  2. #2
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,826
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: ld linker problem, PATH variable

    The PATH is defined in /etc/environment and can be modified/overridden in locations like ~/.profile or ~/.bashrc.

  3. #3
    Join Date
    Jun 2007
    Beans
    17,337

    Re: ld linker problem, PATH variable

    The other question is why do you have a version of ld in /usr/local/bin to begin with?

  4. #4
    Join Date
    Apr 2013
    Beans
    4

    Re: ld linker problem, PATH variable

    Good question, and one I don't know the answer to. I just deleted the ld copy in /usr/local/bin and it works perfectly now all the time. Thanks!

Tags for this Thread

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
  •