Thread: C Compile error on RHEL 5

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    1

    Unhappy C Compile error on RHEL 5

    I am not a programmer, so please be easy on me.
    I have been asked to compile an application on RHEL 4 and 5 servers. I have been successful with a simple command as follows ;
    [tag]
    [root@rayn02 bin]# cc wholocks.c -o wholocks
    [/tag]

    However, when I try and compile on this particualter RHEL5 server it gets really messy.
    [tag]
    [root@rayn02 bin]# cc wholocks.c -o wholocks
    wholocks.c:10:1: warning: "O_RDWR" redefined
    In file included from /usr/include/fcntl.h:34,
    from wholocks.c:3:
    /usr/include/bits/fcntl.h:36:1: warning: this is the location of the previous definition
    wholocks.c: In function âmainâ:
    wholocks.c:45: warning: incompatible implicit declaration of built-in function âexitâ
    wholocks.c:62: warning: incompatible implicit declaration of built-in function âexitâ
    wholocks.c:68: warning: incompatible implicit declaration of built-in function âexitâ
    /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in /tmp/cc3T8B3O.o
    /lib64/libc.so.6: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    [root@rayn02 bin]#

    [/tag]

    The libc programs installed include the following;

    [tag]
    [root@rayn02 bin]# rpm -qa |grep libc
    libcap-1.10-26
    glibc-2.5-24
    glibc-headers-2.5-24
    compat-glibc-2.3.4-2.26
    glibc-common-2.5-24
    libcap-devel-1.10-26
    compat-glibc-2.3.4-2.26
    libcroco-0.6.1-2.1
    glibc-devel-2.5-24
    libcroco-0.6.1-2.1
    libchewing-0.3.0-8.el5
    glibc-2.5-24
    libcap-1.10-26
    glibc-devel-2.5-24
    libcap-devel-1.10-26
    compat-glibc-headers-2.3.4-2.26
    [/tag]

    Anyone indeas on what I might be missing?

    Thanks in advance

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by IT_CANADA View Post
    Anyone indeas on what I might be missing?
    Are they both 64-bit?
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    If you don't have a declaration of exit, you're missing a header. Specifically, you're missing <stdlib.h>.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C and C++ compile speed
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2007, 02:37 PM
  2. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 01:36 PM
  3. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 08:20 AM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 09:05 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 02:58 PM