compile error
Moderator: Board moderators
compile error
not sure why... but I get a compile error when I try to submit my program....
Here are the compiler error messages:
01101644_24.c:5: `#include' expects "FILENAME" or
--
source:
/* @JUDGE_ID: XXXXXX 100 C++ "Looping" */
#include<iostream.h>
int main()
{
long n,x,p,i=0,bigi=0;
long first,last;
cin>>p>>x;
first=p; last=x;
while(p<=x) {
n=p;
while(1) {
if(n==1) {i++; /*cout<<i<<" ";*/ break;}
i++;
if(n%2!=0)
n=3*n+1;
else
n=n/2;
}
if(i>bigi) bigi=i;
p++;
i=0;
}
cout<<first<<" "<<last<<" "<<bigi;
cout<<endl;
return 0;
}
Here are the compiler error messages:
01101644_24.c:5: `#include' expects "FILENAME" or
--
source:
/* @JUDGE_ID: XXXXXX 100 C++ "Looping" */
#include<iostream.h>
int main()
{
long n,x,p,i=0,bigi=0;
long first,last;
cin>>p>>x;
first=p; last=x;
while(p<=x) {
n=p;
while(1) {
if(n==1) {i++; /*cout<<i<<" ";*/ break;}
i++;
if(n%2!=0)
n=3*n+1;
else
n=n/2;
}
if(i>bigi) bigi=i;
p++;
i=0;
}
cout<<first<<" "<<last<<" "<<bigi;
cout<<endl;
return 0;
}
-
- Guru
- Posts: 834
- Joined: Wed May 29, 2002 4:11 pm
- Location: Wroclaw, Poland
- Contact:
I'm not sure what's true, but possible reasons of that could be:
1. maybe try to add space between 'include' and '<ios....'
2. <iostream.h> is not part of ANSI C++ (I write my solutions in C only and I don't know that
)
3. <iostream.h> is part of ANSI C++, but isn't allowed by judge
Best regards
Dominik
1. maybe try to add space between 'include' and '<ios....'
2. <iostream.h> is not part of ANSI C++ (I write my solutions in C only and I don't know that

3. <iostream.h> is part of ANSI C++, but isn't allowed by judge
Best regards
Dominik
-
- System administrator & Problemsetter
- Posts: 399
- Joined: Sat Jan 12, 2002 2:00 am
HTML
May be u r sending your email in html format. You should send it in plain text format
this happened when using iostream, don't know why though...
change:
into:
and submit as C++
and like picard said.. you got wrong answer
change:
Code: Select all
#include <iostream.h>
Code: Select all
#include <iostream>
and like picard said.. you got wrong answer

<iostream.h> is not part of ANSI C++, but is allowed by the judge.Dominik Michniewski wrote:I'm not sure what's true, but possible reasons of that could be:
1. maybe try to add space between 'include' and '<ios....'
2. <iostream.h> is not part of ANSI C++ (I write my solutions in C only and I don't know that)
3. <iostream.h> is part of ANSI C++, but isn't allowed by judge
Best regards
Dominik
All standard headers (not necessarily being files) have no suffix.
-
- Guru
- Posts: 834
- Joined: Wed May 29, 2002 4:11 pm
- Location: Wroclaw, Poland
- Contact:
I know, that i.e. <vector>, <algorithm> are standard C++ header files, but I don't know what set of such files are allowed by judge !
I couldn't find any word on this site about list of allowed headers and functions - and if I want to avoid Compile Error I can't use it
When I write programs in C I know, that any header from standard ANSI C is allowed - could you tell me when I could find such list for ANSI C++?
In C it's very limited list - no more than ten files ...
Best regards
Dominik
I couldn't find any word on this site about list of allowed headers and functions - and if I want to avoid Compile Error I can't use it

When I write programs in C I know, that any header from standard ANSI C is allowed - could you tell me when I could find such list for ANSI C++?
In C it's very limited list - no more than ten files ...

Best regards
Dominik
Since the judge uses gcc (seems 2.95), just check the documentations. If you make heavy use of Standard C++ Library, then you'll be frustrated as I am because libstdc++ is not very conformant.Dominik Michniewski wrote:I know, that i.e. <vector>, <algorithm> are standard C++ header files, but I don't know what set of such files are allowed by judge !
I couldn't find any word on this site about list of allowed headers and functions - and if I want to avoid Compile Error I can't use it
When I write programs in C I know, that any header from standard ANSI C is allowed - could you tell me when I could find such list for ANSI C++?
In C it's very limited list - no more than ten files ...![]()
Best regards
Dominik
-
- New poster
- Posts: 3
- Joined: Sun Oct 06, 2002 9:49 pm
I use Java and hardly can submit due to compiled error.
Could anybody help me with this??
Here are the compiler error messages:
/tmp/cc4XPsPymain.o: In function `main':
/tmp/ccQ4tHyCmain.i(.text+0x12): undefined reference to `_CL_4Main'
collect2: ld returned 1 exit status
Could anybody help me with this??
Here are the compiler error messages:
/tmp/cc4XPsPymain.o: In function `main':
/tmp/ccQ4tHyCmain.i(.text+0x12): undefined reference to `_CL_4Main'
collect2: ld returned 1 exit status
A gentle man is a patient wolf.