problems compiling from source in RH9
when trying to compile an extracted tar.gz file from source i get an error for
sh ./config saying something along the lines of: # Testing to see if can compile in C --- config error: compiling in c failed I've got all DK packages installed from RH9 CDs so I dont know why i get this error, but I get it for various source programs when running ./config so i have no idea what problem is I'll include the actuall error message tommorow if that would be helpful, I'm too tired to boot up my linux system again tonight |
Do you have installed the gcc ore any other compiler? My guess is, that you proberly didn't install the compiler. It comes with your distribution, but if you didn't install it, you can't compile ANYTHING. To check if it is installed, type:
gcc --version. If your computer, can't find gcc. you will need to locate, and install all the packages, that has something to do with gcc. Don't try to save space, gcc is worth the space a thousand times. |
the error message :
[rob@localhost k3b_burner]$ cd id3lib-3.8.3 [rob@localhost id3lib-3.8.3]$ sh ./configure checking for a BSD-compatible install... /usr/bin/install -c 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'. and I do have gcc installed : [rob@localhost id3lib-3.8.3]$ gcc --version gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I've installed every Developer Kit package on the CD what could be the problem? |
try just doing ./configure instead of sh ./configure
|
that doesnt work, just comes up saying something about errors and bash/sh
|
okay, try to see, if you can compile and run the code below. if you can, i have no idea of what is wrong. if you can't run the output program, i would say the problem lies in your compiler. If so, you can get a new compiler from http://www.gnu.org.
Code:
#include<stdio.h> |
how do i use gcc for this file (any params)? What extension do I give the file; .c, .h, .i ??
after compilation is there any trick to running it? |
save it to any file, with the ending in .c.
compile it using gcc filename -o test and then start it using: ./test |
i get the following:
[root@localhost ,linux]# gcc foobar.c -o test foobar.c:5:2: warning: no newline at end of file [root@localhost ,linux]# ./test bash: ./test: Permission denied where foobar.c is the code from above Am i doing something wrong or is it my compiler? |
your compiler should have changed the permisions on the file to executable. Doing so, is required to be able to run the program. To manualy assign execute permision to the program, run:
chmod +x test then you should be able to run the program. Why the compiler doesn't set the permisions, i have no idea, but it is a normal feature of gcc. |
the file has execute permissions (i even ran chmod +x test) but I still get the message:
[root@localhost ,linux]# ./test bash: ./test: Permission denied ?? is it my compiler thats broken or redhat9 itself? |
Does it also have read permisions, I think that you should be able to run it as root. I am however not 100% sure. To give it read permisions: run
chmod +r test the try to run it again. |
yea it has read permissions
... what should I do? |
Even if the program has exection and read permisions, it may still depend on the libaries used. Since the gcc compiler link your program with standard libaries, wich i stored out side of the program file to save space, you might want to check, wether theese libaries have the correct permisions. to check this, type the following at any terminal:
ls -l `ldd test |cut -d\ -f3` If this doesn't show that all the libaries have read and (i don't know if it is needed, but it can't hurt) execution permisions, change the permsions. if that still doesn't help, install a new compiler. |
All times are GMT -5. The time now is 11:53 AM. |