Trouble compiling a couple programs
Trouble compiling a couple programs
I'm trying to compile a couple programs and I keep getting an error telling me the compiler cannot create executables. I get the same error with both gcc and clang. But both easily compile trivial programs I've copied and pasted from the internet. So I'm confident the problem is the source code. But I have no idea how to diagnose it. There is another thread here on the same problem, but the answer is specific to a SlackBuild so it doesn't really help me.
Re: Trouble compiling a couple programs
Would specifics really make a difference? I doubt it's a problem with the source code. I suspect I have somehow screwed something up (again). Or maybe something broke when I installed llvm and then removed it. All I know is that all the Google results for " C compiler cannot create executibles" lead to dead-end answers.
I suspect it's a problem with the linker. I say this because the trivial programs compile and run just fine, but they don't use any outside libraries. The browser and window manager I was trying to compile both obviously make quite a few links. So maybe I changed a variable somewhere that's causing the linker to look in the wrong place for the libraries.
Or maybe the compiler can't find the libraries because I'm running the builds in a directory off the PATH. But the PATH is correct, so it should still be able to find everything. I did have '/usr/local/bin' first in the PATH. I moved it further down the list. That didn't help.
I'm not really using that computer for anything. I'll probably just reinstall to wipe out whatever is wrong.
I suspect it's a problem with the linker. I say this because the trivial programs compile and run just fine, but they don't use any outside libraries. The browser and window manager I was trying to compile both obviously make quite a few links. So maybe I changed a variable somewhere that's causing the linker to look in the wrong place for the libraries.
Or maybe the compiler can't find the libraries because I'm running the builds in a directory off the PATH. But the PATH is correct, so it should still be able to find everything. I did have '/usr/local/bin' first in the PATH. I moved it further down the list. That didn't help.
I'm not really using that computer for anything. I'll probably just reinstall to wipe out whatever is wrong.
Re: Trouble compiling a couple programs
Yes.Sasquatch wrote:Would specifics really make a difference?
Re: Trouble compiling a couple programs
Reisntalling may be best. But if you did want help trying to fix it, specifics are the only way. "Help" means an interactive process of diagnosis, which depends on information and detail.
In more general terms, it is worth underlining that if you mess with things, unless you know exactly what you are doing (which also implies: why and what for), you are likely to break them to the point where, indeed, a fresh install is by far the easiest way forward.
One harmless way of doing that might be in a VM. In general terms, that's a useful way of testing anything that's a bit experimental or seems likely to be risky. If it goes wrong you can just wipe it clean and start again.
In more general terms, it is worth underlining that if you mess with things, unless you know exactly what you are doing (which also implies: why and what for), you are likely to break them to the point where, indeed, a fresh install is by far the easiest way forward.
One harmless way of doing that might be in a VM. In general terms, that's a useful way of testing anything that's a bit experimental or seems likely to be risky. If it goes wrong you can just wipe it clean and start again.