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

×

Why do i get a compile error?

My code compiles on my machine, however, it gets compilation error on CodeChef why so?

asked 20 Mar '13, 15:57

rudreshwar's gravatar image

1★rudreshwar
457192531
accept rate: 50%

edited 20 Mar '13, 16:09


There are a few reasons why your code may compile on your computer but not on Codechef. In all cases, you can see the compile error by clicking on the Compile Error icon after submitting your code.

Java:

Your class containing the main method must be a public class called Main. It may not be called anything else. Do not use packages.

C/C++:

Make sure you are using a compiler that complies with the standards. Turbo C++ is not such a compiler, and often code which compiles in Turbo C++ will not compile on CodeChef.

Make sure you are using standard headers. Do not use conio.h in C; this is not part of the C standard library. Do not use iostream.h; this is a deprecated header file and again is not a standard library. (You should just be using iostream instead).

The flags used for C++ are: g++ -pipe -O2 -lm -s -fomit-frame-pointer

Other languages:

As with C/C++, make sure you are using a standard compiler/interpreter. The exact ones that Codechef uses are listed next to the language when submitting the program. Read the sample solutions page to see an example of code which compiles and correctly solves the TEST program as a starting point.

Read the sample solutions page to see an example of code which compiles and correctly solves the TEST program as a starting point.

link

answered 20 Mar '13, 16:05

admin's gravatar image

0★admin ♦♦
19.6k349497539
accept rate: 35%

if turbo compiler is not such compiler than which compiler should i use?

link

answered 26 Sep '15, 23:16

kunnu27's gravatar image

0★kunnu27
1
accept rate: 0%

watch on you tube how to submit a program on codechef,then you will find out solution of your problem.

link

answered 26 Sep '15, 23:23

a2hksy's gravatar image

5★a2hksy
16
accept rate: 50%

code chef uses certain set of compiler for assessment.. try to use the same on your machine.. there is difference between how you write code in turbo c++ and gcc compiler

link

answered 27 Sep '15, 01:10

psganesh_01's gravatar image

2★psganesh_01
1
accept rate: 0%

instead of conio.h which library should i use????

link

answered 12 Mar '16, 13:14

fkhan786's gravatar image

1★fkhan786
1
accept rate: 0%

while submitting the code .. we are getting wrong answer as an error even though it is compiling and giving the output in the codechef compiler.

link

answered 12 Mar '16, 14:49

kiranentwikler's gravatar image

0★kiranentwikler
1
accept rate: 0%

Well Basically Compilation Error Occurs When You Dont Follow The Syntax Which Is Used While Coding Like Skipping The ';' or forgetting to close the } or if u make the incorrect for construct and many more times.

Also Do Check If You Have Selected The Correct Language In The Submission Page As Sometimes In A Hurry We Often Chose The Wrong Language.

link

answered 12 Mar '16, 15:39

cyborg_7's gravatar image

2★cyborg_7
11
accept rate: 0%

prog.c:2:18: fatal error: conio.h: No such file or directory

#include < conio.h >

compilation terminated


I encountered the above compilation error... Whats the problem?

link

answered 06 Apr '16, 19:31

depanshusani's gravatar image

0★depanshusani
1
accept rate: 0%

@depanshushani , don't use it at all. Use only <stdio.h>. Codechef doesn't use Turbo C compiler. :)

link

answered 06 Apr '16, 20:13

dibya1rb12_3's gravatar image

3★dibya1rb12_3
121
accept rate: 0%

@kunnu27 I use CodeBlocks. It is Best. You can download it and code here.

And I suggest you to code on codechef online IDE.

link

answered 09 Apr '16, 19:43

jaydeep97's gravatar image

5★jaydeep97
462
accept rate: 20%

My code works fine on codeblocks and codechef IDE still I get compile time error. Can someone help me out.

link

answered 13 Jan '17, 22:30

cipher_123_'s gravatar image

2★cipher_123_
1
accept rate: 0%

My code works fine on codeblocks and codechef IDE still I get compile time error. Can someone help me out.

link

answered 13 Jan '17, 22:32

cipher_123_'s gravatar image

2★cipher_123_
1
accept rate: 0%

If code blocks is such a compiler ?

link

answered 08 Jan, 20:02

emperor1998's gravatar image

0★emperor1998
1
accept rate: 0%

Yes. Sometimes output of codeblocks and codechef do differ- but ultimately thats due to some fault in your code which codeblocks ignores but codechef doesnt.

(08 Jan, 20:03) vijju123 ♦♦5★

My programs ran successfully in code blocks . conio.h is not used in my program . Time doesn't exceeded . In codeblocks my program gave right output . Then why my answer is shown as wrong in codechef ?

link

answered 08 Jan, 20:05

emperor1998's gravatar image

0★emperor1998
1
accept rate: 0%

I am trying to run my program written fir solving the problem "Fake Binary Search" as a part of "May challenge 2018 DivB" but I am getting a strange compilation error for my JAVA code. Firstly, the program takes almost 40 minutes to run and the ide says "Submission Queued". After completion, I get the following compilation error: <html>

Not Found

The resource could not be found.

</html>

Please help me someone. I am facing this strange issue first time. Is this a fault of mine or the codechef server has a problem?

link

answered 10 May, 12:24

p1p5_5's gravatar image

3★p1p5_5
708
accept rate: 0%

It has been the same for everyone for more than 1 hour. There are some problems with codechef submission. Admin, please fix this issue asap.

(10 May, 13:35) skarthick3★

I am trying to run my program written fir solving the problem "Fake Binary Search" as a part of "May challenge 2018 DivB" but I am getting a strange compilation error for my JAVA code. Firstly, the program takes almost 40 minutes to run and the ide says "Submission Queued". After completion, I get the following compilation error: <html>

Not Found

The resource could not be found.

</html>

Please help me someone. I am facing this strange issue first time. Is this a fault of mine or the codechef server has a problem?

link

answered 10 May, 12:26

p1p5_5's gravatar image

3★p1p5_5
708
accept rate: 0%

Hello. So the following the code which works absolutely fine in netbeans but when I upload on CODECHEF, it shows COMPILATION ERROR. Plz help.

import java.util.Scanner; public class Main {

public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int l,b;
System.out.println("Enter length and breadth: ");
l=in.nextInt();
b=in.nextInt();
float area, peri;
area = l*b;
peri = 2*(l+b);
if(area>peri){
    System.out.println("Area");
    System.out.println("Area="+area);
}
else
    System.out.println("Perimeter");
System.out.println("Perimeter"+peri);

} }

link

answered 02 Jul, 11:48

pari97's gravatar image

0★pari97
32
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:

×206
×34
×33
×5

question asked: 20 Mar '13, 15:57

question was seen: 15,450 times

last updated: 02 Jul, 11:51