Trouble compiling a couple programs

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
Sasquatch
Posts: 155
Joined: 26. Mar 2014, 00:50

Trouble compiling a couple programs

Post by Sasquatch »

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.
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Trouble compiling a couple programs

Post by gapan »

All the couples of programs I have tried were OK.
Image
Image
Sasquatch
Posts: 155
Joined: 26. Mar 2014, 00:50

Re: Trouble compiling a couple programs

Post by Sasquatch »

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.
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Trouble compiling a couple programs

Post by gapan »

Sasquatch wrote:Would specifics really make a difference?
Yes.
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Trouble compiling a couple programs

Post by mimosa »

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.
Post Reply