Arthur Vaïsse
Arthur Vaïsse

Reputation: 1571

How to make GCC detect standard C library?

my problem is the following : In order to build some specific library I have to install GCC on a red hat without access to Internet and no way to use yum.

For now I did :

1)I installed gcc-x86_64-linux-gnu (and it's dependencies)

2) I created symbolic links in /usr/bin for the following installed executables : /usr/bin/x86_64-linux-gnu-cpp, /usr/bin/x86_64-linux-gnu-gcc, /usr/bin/x86_64-linux-gnu-gcov using sudo ln -s /usr/bin/x86_64-linux-gnu-<end> <end> So I have functional gcc cpp and gcov command.

3) I tested a ./configure on my library to build and get GCC saying that the C compiler isn't able to create C executable. I so tested to create a simple hello world C program.

#include<stdio.h>
int main(void){
        printf("hello world!\n");
        return 0;
}

when running gcc ./hello.c -o helloI got the this error : "fatal error : stdio.h : no such file or directory".

4) I did a ls /usr/include | grep .h but found nothing. Conclusion : standard C libs aren't installed.

5) I so installed glibc-devel to import the standard C library, and now the same command show numerous C files, including the stdio.h file.

But my GCC still raising the same fatal error. Any idea about what should I do make to make it work ?

I don't think the problem here is related to x86 / x64 problem as it is suggested in this question

Upvotes: 1

Views: 405

Answers (1)

lsunny
lsunny

Reputation: 160

From your post i assume that this is related to improper installation, before installing a package make sure you use the proper package to the proper distribution as compatibility issues may arise with 32 Bit or 64 Bit OS package. You could try the below method by using a Red Hat Boot CD.

Install rpm from CDROM/DVD

Mount your RHEL Linux CD/DVD and install the following packages using rpm command:

$rpm -ivh gcc*

Upvotes: 1

Related Questions