[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: collect2: fatal error: cannot find 'ld'

From: znavko
Subject: Re: collect2: fatal error: cannot find 'ld'
Date: Sun, 10 Feb 2019 11:28:45 +0100 (CET)

Installation of gcc-toolchain did not help.

$ guix package -I |grep gcc
gcc-toolchain    8.2.0    out    /gnu/store/xwk99qi92pm3zqd95mvjx4mkdmg8plpk-gcc-toolchain-8.2.0

$ gcc c
c: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status

$ cat c
#include <sys/stat.h>
#include <stdio.h>

int main(void)
    struct stat stats;

    if (!stat("/", &stats))
        printf("%u\n", stats.st_blksize);

Feb 9, 2019, 2:35 PM by address@hidden:

address@hidden writes:
Hi! I compile this <>

and get this:

$ gcc c.c
collect2: fatal error: cannot find 'ld'
compilation terminated.

$ whereis ld

$ gcc --version
gcc (GCC) 8.2.0

How to solve this?

I’m assuming that you installed the “gcc” package. Don’t do that.
Install “gcc-toolchain” instead.

guix package -r gcc -i gcc-toolchain


reply via email to

[Prev in Thread] Current Thread [Next in Thread]