What does "undefined reference to main" mean? [closed]

asked 2014-11-20 05:38:30 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by FranciscoD_
close date 2014-11-20 09:46:15.871715

Comments

This isn't a Fedora question at all really. Have you googled at all? Just looking for "undefined reference to main" I get many many answers on the internet.

FranciscoD_ gravatar imageFranciscoD_ ( 2014-11-20 09:45:54 -0500 )edit

Well I was running the C++ code there I was facing this error. it was working fine in past days but today I got this error. I thought may be this because of fedora. thanks anyway.

adnanrashidpk gravatar imageadnanrashidpk ( 2014-11-20 15:00:57 -0500 )edit

No. This shouldn't be because of Fedora. In any case, it's really difficult to debug without looking at the source code that you've written. The question is much better suited to programming forums :)

FranciscoD_ gravatar imageFranciscoD_ ( 2014-11-20 16:37:40 -0500 )edit