1

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

Community
  • 1
  • 1
Arthur Vaïsse
  • 1,551
  • 1
  • 13
  • 26
  • I guess x86_64 vs i386 issue – user3159253 Apr 10 '15 at 07:39
  • run gcc -v to find where it has searched. – tristan Apr 10 '15 at 08:09
  • 1
    You installed a cross-compiler. Otherwise you shouldn't have needed to set up the symlinks. Either find a way to get the box on the Internet or search the installation discs (if there are any and you can get them) to see if GCC is on any of them. Also, the version of glibc you installed was for the i386 arch, not the x86_64 arch you seem to want. –  Apr 10 '15 at 08:12

1 Answers1

1

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*
lsunny
  • 160
  • 1
  • 2
  • 12