help-guix
[Top][All Lists]
Advanced

[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:45:03 +0100 (CET)

Sorry. The file extension was the solution:

$ mv c c.c
$ gcc c.c
$ ./a.out
4096




Feb 10, 2019, 10:28 AM by address@hidden:
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 https://stackoverflow.com/questions/6161823/dd-how-to-calculate-optimal-blocksize <https://stackoverflow.com/questions/6161823/dd-how-to-calculate-optimal-blocksize>

and get this:

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

$ whereis ld
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

--
Ricardo



reply via email to

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