Compiler WON'T work at ALL!!
whenever I try to './configure' anything I get this: bash: ./configure: /bin/sh: bad interpreter: Permission denied and when I do 'bash ./configure', 'sh ./configure', or even 'zsh ./configure' i get this: checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking for -p flag to install... yes checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. steven@linux:~/Documents/other/RPMs/SuSE/Look/kerastik-0.1> I use SuSE 9.1 kernel 2.6.4-52-default with gcc-3.3.3 (the one that came with SuSE.) I'm pretty sure that it is the compiler because i did 'export CC=~/bin/gcc' which was an empty text file, and got the same output except the line: checking for gcc... gcc was replaced with: checking for gcc... /home/steven/bin/cc and i got the same checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. stuff. what is wrong?
On Thu, 23 Sep 2004 09:20:40 -0700
Steven Pasternak
compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. steven@linux:~/Documents/other/RPMs/SuSE/Look/kerastik-0.1>
I use SuSE 9.1 kernel 2.6.4-52-default with gcc-3.3.3 (the one that came with SuSE.) I'm pretty sure that it is the compiler because i did
'export CC=~/bin/gcc' which was an empty text file, and got the same output except the line:
checking for gcc... gcc
was replaced with:
checking for gcc... /home/steven/bin/cc
and i got the same
checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details.
stuff. what is wrong? export CC=~/bin/gcc Do NOT do this. You are pointing to gcc in your HOME directory (eg /home/steven/bin).
Here is a test you should run:
1. Build a simple hello world:
#include
Jerry Feldman wrote:
On Thu, 23 Sep 2004 09:20:40 -0700 Steven Pasternak
wrote: compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. steven@linux:~/Documents/other/RPMs/SuSE/Look/kerastik-0.1>
I use SuSE 9.1 kernel 2.6.4-52-default with gcc-3.3.3 (the one that came with SuSE.) I'm pretty sure that it is the compiler because i did
'export CC=~/bin/gcc' which was an empty text file, and got the same output except the line:
checking for gcc... gcc
was replaced with:
checking for gcc... /home/steven/bin/cc
and i got the same
checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details.
stuff. what is wrong?
export CC=~/bin/gcc Do NOT do this. You are pointing to gcc in your HOME directory (eg /home/steven/bin).
Here is a test you should run: 1. Build a simple hello world: #include
int main() { printf("Hello, world!\n"); return 0; } 2. compile that program: gcc hello.c -o hello 3. run the program: ./hello
This will test that the C compiler works, and that your include files are installed.
That worked, but doing './configure' still gives me the crud, and 'sh ./configure' still gives me trouble.
On Thu, 23 Sep 2004 10:15:40 -0700
Steven Pasternak
Jerry Feldman wrote:
On Thu, 23 Sep 2004 09:20:40 -0700 Steven Pasternak
wrote: compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. steven@linux:~/Documents/other/RPMs/SuSE/Look/kerastik-0.1>
I use SuSE 9.1 kernel 2.6.4-52-default with gcc-3.3.3 (the one that came with SuSE.) I'm pretty sure that it is the compiler because i did> 'export CC=~/bin/gcc' which was an empty text file, and got the same
output except the line:
checking for gcc... gcc
was replaced with:
checking for gcc... /home/steven/bin/cc
and i got the same
checking whether the C compiler works... configure: error: cannot run>C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details.
stuff. what is wrong?
export CC=~/bin/gcc Do NOT do this. You are pointing to gcc in your HOME directory (eg /home/steven/bin).
Here is a test you should run: 1. Build a simple hello world: #include
int main() { printf("Hello, world!\n"); return 0; } 2. compile that program: gcc hello.c -o hello 3. run the program: ./hello
This will test that the C compiler works, and that your include files are installed.
That worked, but doing './configure' still gives me the crud, and 'sh ./configure' still gives me trouble. Make sure that the export statement is not in your ./bashrc Remember that a script is going to read your environment because it is a new process. So, if you simply unset it in the current environment and did not fix your .bashrc, then the problem would recur.
After cleaning up your environment try the ./configure.
The first line of configure is usually:
#! /bin/sh
That means it will execute /bin/sh, or the Bourne shell.
It appears to me that you put stuff in your .bashrc that is causing
problems, or for some reason the symlink in /bin got clobbered.
lrwxrwxrwx 1 root root 4 2004-01-26 12:14 /bin/sh -> bash
On EVERY Unix or Linux site you must have the Bourne shell in /bin.
Since the ./configure script should have #! /bin/sh it might appear that
it is clobbered or that your environment is doing something wierd.
Try this, and you should get a result similar to mine.
gaf@gaf:~> /bin/sh
sh-2.05b$
--
Jerry Feldman
Jerry Feldman wrote:
On Thu, 23 Sep 2004 10:15:40 -0700 Steven Pasternak
wrote: Jerry Feldman wrote:
On Thu, 23 Sep 2004 09:20:40 -0700 Steven Pasternak
wrote: compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. steven@linux:~/Documents/other/RPMs/SuSE/Look/kerastik-0.1>
I use SuSE 9.1 kernel 2.6.4-52-default with gcc-3.3.3 (the one that came with SuSE.) I'm pretty sure that it is the compiler because i
did>
'export CC=~/bin/gcc' which was an empty text file, and got the same
output except the line:
checking for gcc... gcc
was replaced with:
checking for gcc... /home/steven/bin/cc
and i got the same
checking whether the C compiler works... configure: error: cannot
run>C compiled programs.
If you meant to cross compile, use `--host'. See `config.log' for more details.
stuff. what is wrong?
export CC=~/bin/gcc Do NOT do this. You are pointing to gcc in your HOME directory (eg /home/steven/bin).
Here is a test you should run: 1. Build a simple hello world: #include
int main() { printf("Hello, world!\n"); return 0; } 2. compile that program: gcc hello.c -o hello 3. run the program: ./hello
This will test that the C compiler works, and that your include files are installed.
That worked, but doing './configure' still gives me the crud, and 'sh ./configure' still gives me trouble.
Make sure that the export statement is not in your ./bashrc Remember that a script is going to read your environment because it is a new process. So, if you simply unset it in the current environment and did not fix your .bashrc, then the problem would recur.
After cleaning up your environment try the ./configure.
The first line of configure is usually: #! /bin/sh
That means it will execute /bin/sh, or the Bourne shell. It appears to me that you put stuff in your .bashrc that is causing problems, or for some reason the symlink in /bin got clobbered. lrwxrwxrwx 1 root root 4 2004-01-26 12:14 /bin/sh -> bash
On EVERY Unix or Linux site you must have the Bourne shell in /bin. Since the ./configure script should have #! /bin/sh it might appear that it is clobbered or that your environment is doing something wierd.
Try this, and you should get a result similar to mine. gaf@gaf:~> /bin/sh sh-2.05b$
typing 'sh' worked, and i deleted ~/.bashrc and still no luck. when i made the 'hello world' program, the executable was 'a.out', not 'hello' like you said it should be.
On Thu, 23 Sep 2004 12:31:15 -0700
Steven Pasternak
Here is a test you should run: 1. Build a simple hello world: #include
int main() { printf("Hello, world!\n"); return 0; } 2. compile that program: gcc hello.c -o hello 3. run the program: ./hello
Try this, and you should get a result similar to mine. gaf@gaf:~> /bin/sh sh-2.05b$
typing 'sh' worked, and i deleted ~/.bashrc and still no luck. when i made the 'hello world' program, the executable was 'a.out', not 'hello' like you said it should be. You did not follow my directions. Note that step 2 was "gcc hello.c -o hello" This build hello, not a.out. If you do not use the -o command line option the compiler will create a.out.
From what you indicated from the ./configure log, it is failing because
WRT: sh
Again, you failed to follow my instructions, type the full absolute path
"/bin/sh"
And, you should not have deleted your ~/.bashrc, but you can fix that by
copying the skeleton /etc/skel/.bashrc
The ~/.bashrc file is important in customizing your system, but for this
exercise, deleting it will be ok.
there is a problem with /bin/sh
I'm not sure what your experience is with Linux, but at the risk of
sounding too pedantic:
Absolute path: This starts with the forward slash (/). You will be
guaranteed to execute the Linux command in that directory.
Relative path: Normally this starts either with . or ..
It references relative to your current working directory.
~ This is a shortcut to your home directory (you can use the environment
variable, $HOME. Strict Bourne shell syntax does not recognize the tilde
(~), but BASH and Cshell does.
Specifying a command by itself, such as sh, causes the system to search
your PATH environment variable. Remember, by default, the current
directory (eg. .) is never in your path. So, if you try to run your
hello program by typing hello, it will fail, but using relative path as
in ./hello will work.
After all is said, your initial problem was that you set up the CC
environment variable to point to your bin directory, which was wrong.
But the other problem:
./configure where it said invalid command interpreter, was referring to
the #! line.
#! causes the loader to run the command following the bang.
#! /usr/local/bin/foo
This causes /usr/local/bin/foo to be used as the command interpreter.
Usually you will see /bin/sh or /bin/bash there. This way the script
writer identifies the language the script is written in. It expects the
Bourne and Bash shells to be in the /bin directory. In the case of SuSE
9.0 and 9.1 this is a symlink to bash. Bash is a POSIX shell and should
run transparently as sh.
--
Jerry Feldman
participants (2)
-
Jerry Feldman
-
Steven Pasternak