You are not logged in.

#1 2024-10-24 05:44:07

hat-tip
Member
Registered: 2024-10-23
Posts: 11

[closed] problem: C compiler cannot create executables.

Hi there, I've searched all over and tried a few suggestions already. Will copy some history below and a few details of what I have already tried.

So basically I am learning how to extract and install tar files from source.

The tutorial has led me to this point and now I am getting the above error.

I have reinstalled gcc, and base devel, but the problem persists.

Am I missing something obvious?
TIA

Here is a brief history of my command line:

[hat-tip@archlinux units-1.74]$ less README
[hat-tip@archlinux units-1.74]$ mkdir ~/units174
[hat-tip@archlinux units-1.74]$ ./configure --prefix=$HOME/units174
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
[hat-tip@archlinux units-1.74]$ echo $HOME
/home/hat-tip
[hat-tip@archlinux units-1.74]$ ./configure --prefix=$HOME/units174
loading cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
[hat-tip@archlinux units-1.74]$ ./configure --prefix=$HOME/hat-tip/units174
loading cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

Last edited by hat-tip (2024-10-24 12:16:11)

Offline

#2 2024-10-24 05:56:51

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

OK after a reboot, I am trying again and now it just says No such file or directory exists.

I've tried using different variables of $HOME as noted in the tutorial but I am definitely missing something.

I have tried:
./configure --prefix=$/hat-tip@archlinux/units174

./configure --prefix=$HOME/units174

./configure --prefix=$HOME/hat-tip/units174

./configure --prefix=$HOME/units174

P.S the directory does exist as i repeated that step and got the result:

[hat-tip@archlinux ~]$ mkdir ~/units174
mkdir: cannot create directory ‘/home/hat-tip/units174’: File exists

Last edited by hat-tip (2024-10-24 05:57:51)

Offline

#3 2024-10-24 07:07:35

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [closed] problem: C compiler cannot create executables.

OK after a reboot, I am trying again and now it just says No such file or directory exists.

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
What says what exactly doesn't exist?

gcc --version
type -a gcc

Offline

#4 2024-10-24 08:57:25

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

The file that is in my question above "units174"

[hat-tip@archlinux ~]$ ./configure --prefix=$HOME/units174
bash: ./configure: No such file or directory
[hat-tip@archlinux ~]$ ./configure --prefix=$HOME/units174
bash: ./configure: No such file or directory
[hat-tip@archlinux ~]$ mkdir ~/units174
mkdir: cannot create directory ‘/home/hat-tip/units174’: File exists
[hat-tip@archlinux ~]$ ./configure --prefix=$HOME/units174
bash: ./configure: No such file or directory
[hat-tip@archlinux ~]$ ./configure --prefix=$HOME/hat-tip/units174
bash: ./configure: No such file or directory
[hat-tip@archlinux ~]$ ./configure --prefix=$HOME/units174
bash: ./configure: No such file or directory
[hat-tip@archlinux ~]$ echo $home

[hat-tip@archlinux ~]$ ./configure --prefix=$/hat-tip@archlinux/units174
bash: ./configure: No such file or directory
[hat-tip@archlinux ~]$ sudo fdisk -l /dev/sda
[sudo] password for hat-tip:
fdisk: cannot open /dev/sda: No such file or directory

Offline

#5 2024-10-24 09:00:34

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

[hat-tip@archlinux ~]$ gcc --version
gcc (GCC) 14.2.1 20240910


[hat-tip@archlinux ~]$ type -a gcc
gcc is /usr/bin/gcc

Offline

#6 2024-10-24 10:56:49

cryptearth
Member
Registered: 2024-02-03
Posts: 1,016

Re: [closed] problem: C compiler cannot create executables.

lfs has a simple test for gcc:

echo 'int main(){}' | gcc -

shoukd produce a file called "a.out" - or otherwise will throw an error why gcc doesn't work

Offline

#7 2024-10-24 12:15:02

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

thanks - iĺl give it a shot.
Iḿ thinking of doing a complete re-install actually anyway as I used the arch install to install this version and i feel i missed out a lot of the learning steps along the way. I do think i needed a slightly simpler approach for a while though as it gave me time to learn most of the very basic staple commands. I have dyslexia and have to learn everything 3 times for it to stick. Despite this I am still very inspired and excited about this new learning journey that i am on. Itś fascinating.
I'll mark this as resolved to avoid wasting anyone's time.
I spent the day today printing the manual and other useful docs from the wiki...  Thanks for your time cryptearth.

Offline

#8 2024-10-24 12:30:20

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [closed] problem: C compiler cannot create executables.

[hat-tip@archlinux ~]$ ./configure --prefix=$HOME/units174
bash: ./configure: No such file or directory

./configure does not exist or isn't executable

stat ./configure

./configure --prefix=$/hat-tip@archlinux/units174

That's complete nonsense, please don't enter random stuff into the shell, no matter how frustrated you may be. It's an awesome way to get more frustrated … or panicing.

Offline

#9 2024-10-24 13:00:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [closed] problem: C compiler cannot create executables.

Everything but the very first error in this thread are simply due to you not even being in the proper directory to run configure.  Quite frankly, given this mistake and the ongoing flailing that ensued, I'd strong advise against trying such things again until you understand some fundamentals of how linux and a command shell work (including understanding how directories and relative paths work).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2024-10-24 15:08:09

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

Actually i get the same error when i am in the correct directory.

Anyway, I put this post as closed.

So unless you have anything specific to say regarding this specific error i.e. from experience: "C compiler cannot create executables." please refrain from commenting on this thread.

As for entering random things into the terminal, nothing I entered was random, and I am not ¨panicking" at all. I was simply trying to enter different variables of what might be the correct format of my home directory as per the instructions here to enter echo $HOME

: https://hpc.ncsu.edu/Documents/unixtut/unix7.html

Many thanks.

Offline

#11 2024-10-24 15:18:47

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [closed] problem: C compiler cannot create executables.

from experience: "C compiler cannot create executables.

[hat-tip@archlinux units-1.74]$ ./configure --prefix=$HOME/units174
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... no

Your gcc installation is or was broken.
Whether or not that is still the case is unknown, because the following "errors" are completely unrelated.
There's simply no "configure" file in the location where you're running that command.

nothing I entered was random

Then, how exactly, did you, totally unrandomly, end up with insane bullshit like

./configure --prefix=$/hat-tip@archlinux/units174

That pattern is completely not in https://hpc.ncsu.edu/Documents/unixtut/unix7.html and also not the problem here at all - you're throwing random, made up nonsense into the shell.
That's a recipe for disaster.

Actually i get the same error when i am in the correct directory.

Really?

pwd
ls -la
./configure --prefix=$HOME/units174

Offline

#12 2024-10-24 15:28:31

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

Thanks for reading my response. I will now delete this post as this is just wasting everybody's time.

Thank you.

Offline

#13 2024-10-24 15:33:41

hat-tip
Member
Registered: 2024-10-23
Posts: 11

Re: [closed] problem: C compiler cannot create executables.

Ah well it seems it is not possible to delete posts.

Yes, really. If you read the command lines that I copied in the original post it is there. I was not cd´d into the correct directory I did proceed to cd in to the correct directory and got the same result.

As I have said previously I am no longer seeking any help on this post.

Offline

#14 2024-10-24 15:59:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,300

Re: [closed] problem: C compiler cannot create executables.

Closing by implied request... Note that people here don't seek you ill will, but you seem to have a few fundamental misunderstandings of how a shell works and you're strongly advised to learn more about these concepts before jumping into the deep end.

Offline

Board footer

Powered by FluxBB