You are not logged in. Please login at www.codechef.com to post your questions!

×

Compilation Error : C++ code taken as C

Hi all, I am participating the the September Challenge 2012. When I am submitting my program in c++, I am getting the following compilation error :-

/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function _start': /home/aurel32/tmp/glibc/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference tomain' collect2: ld returned 1 exit status

When I go to My Submissions, it shows me that I submitted the code in C, but while submitting I always select "C++(gcc 4.3.2)". Moreover, I have tried with the extension .cpp as well as .cc, but it didn't help. The code is compiling perfectly fine in my machine(having gcc 4.4.6).

It would be great if anyone of you guide me in what's the correct way of submitting the code in c++. I have already gone through the complete FAQ twice, but didn't find any reference to such a problem.

Regards,

Jayant

asked 10 Sep '12, 18:48

jayantjpr's gravatar image

4★jayantjpr
1223
accept rate: 0%


Do you have a main() function in your program??

link

answered 10 Sep '12, 19:52

goodfornothing's gravatar image

1★goodfornothing
313
accept rate: 0%

@jayantjpr use your official proxy instead of gproxy or ccproxy :D

link

answered 02 Aug '13, 17:23

anilkagak2's gravatar image

3★anilkagak2
1
accept rate: 0%

I was using a memset(), when I removed it the error disappeared ..

link

answered 03 Nov '13, 10:56

rits17_92's gravatar image

2★rits17_92
1
accept rate: 0%

main() function missing

link

answered 21 Aug '14, 18:47

avi_nash's gravatar image

2★avi_nash
381
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,917
×1,424
×525
×19

question asked: 10 Sep '12, 18:48

question was seen: 4,476 times

last updated: 09 Jul '18, 16:03