Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-09-2005, 01:45 AM   #1
Registered: Jan 2005
Posts: 104

Rep: Reputation: 15
C++ compile errors


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:

/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
Old 03-09-2005, 06:28 AM   #2
Registered: Feb 2005
Posts: 95

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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
compile errors. DrunkenDisciple Linux - Software 3 11-29-2005 12:11 AM
c++ compile errors using g++ ttumelty Programming 5 09-08-2005 01:58 PM
compile errors davidleroux1 Programming 4 05-10-2005 10:03 PM
Ndiswrapper Compile Errors ne2007ber Linux - Software 1 01-09-2005 02:33 PM
Compile Errors userini Linux - Software 6 07-16-2003 08:22 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration