Mysterious dependencies missing not asked for when compiling for, when compiling single file profram with clang

I have some c program of a single file size in some file some.c and when running cc some.c I get the following error:

/usr/bin/ld: cannot find crtbeginS.o: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
/usr/bin/ld: cannot find -lgcc_s: No such file or directory

I am running in a Vagrant Docker backed image with the following installs: openSUSE Paste

No one will help?

If the Makefile didn’t list all the dependencies to be installed then it’s clearly something the developer would want to know and can easily fix.

It my own program that has no dependencies more than OpenCL and the standard C library nothing else, is the reason because they are unasked for.

Hmm… maybe install these:

sudo zypper in gcc gcc13 libgcc_s1

You can find out which packages include your missing libraries by doing:

zypper se --file-list --match-words crtbeginS.o libgcc_s libgcc

No my problem is not that I cannot install the missing libraries, but that somehow I am being required to use libraries that don’t put in my code

I don’t understand, how can you run a C program without a C compiler/runtime and its requisite libraries/headers?

I am using the clang compiler

But somehow I am being requested GCC things

Ah okay, now it makes sense.
Clang is a frontend for LLVM and your list of packages in the initial post does not have llvm.

Install it:

sudo zypper in llvm

Still not sure why clang would request gcc stuff when llvm is not installed though :thinking:

Hi,
take a look here:

and here:

https://clang.llvm.org/docs/Toolchain.html

2 Likes

Seeing how deep the rabbit hole goes, I’m reminded of this story. :space_invader::dizzy_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.