LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C++ compile errors (https://www.linuxquestions.org/questions/programming-9/c-compile-errors-299480/)

Palamides 03-09-2005 01:45 AM

C++ compile errors
 
hi

I am trying to compile a piece of code in c++ but I am getting these 2 errors whenever I try to make an executable after compiling w/out any errors:

Code:

/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crt1.o(.text+0x18):In function `_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status

can anyone help me out please, i have no clue what that means. thanks

YetAnotherDave 03-09-2005 06:28 AM

It looks like you don't have a main() routine. Verify this by adding a main routine to one of your files:

Code:

int main()
{
    return 0;
}

If this gets rid of your link problem then your resulting executable may not actually do much - but that's a different issue.

- Dave


All times are GMT -5. The time now is 01:39 PM.