Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Has anyone encountered this error before?

p_vp_v Member Posts: 61
Hello,

While trying to build our code base on Red hat linux using gcc (see details below), we get the following link error:

/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crt1.o(.text+0x18): In function `_start':

: undefined reference to `main'

collect2: ld returned 1 exit status

make: *** [target_build] Error 1

I tried to find answers on the web (still trying) but thought would post this here as well just in case someone has already encountered and resolved this problem.

The gcc version and configuration details that we are using are as follows:

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-49)

Any pointers or advice would be deeply appreciated.

thanks and regards
PV

Comments

  • nugentnugent Member Posts: 87
    : : undefined reference to `main'

    Do you have a main() function ?


    ------
    nugent



  • Elite_WarriorElite_Warrior Member Posts: 1
    May be you have put main in more than one file...

    : Hello,
    :
    : While trying to build our code base on Red hat linux using gcc (see details below), we get the following link error:
    :
    : /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crt1.o(.text+0x18): In function `_start':
    :
    : : undefined reference to `main'
    :
    : collect2: ld returned 1 exit status
    :
    : make: *** [target_build] Error 1
    :
    : I tried to find answers on the web (still trying) but thought would post this here as well just in case someone has already encountered and resolved this problem.
    :
    : The gcc version and configuration details that we are using are as follows:
    :
    : Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
    : Thread model: posix
    : gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-49)
    :
    : Any pointers or advice would be deeply appreciated.
    :
    : thanks and regards
    : PV
    :
    :
Sign In or Register to comment.