View previous topic :: View next topic |
Author |
Message |
KBAKEP n00b


Joined: 07 Dec 2002 Posts: 58 Location: Russia
|
Posted: Wed Dec 25, 2002 9:17 am Post subject: icc compiling problem. |
|
|
I have the latest version of stable software (yesterday I made the last emerge rsync).
While I'm trying to compile my programm with icc, I have the following errors:
/usr/include/stdio.h(44): error #77: this declaration has no storage
class or type specifier
__BEGIN_NAMESPACE_STD
^
/usr/include/stdio.h(46): error: expected a ";"
typedef struct _IO_FILE FILE;
^
/usr/include/stdio.h(47): error: identifier "__END_NAMESPACE_STD" is
undefined
__END_NAMESPACE_STD
^
/usr/include/stdio.h(51): error: identifier "FILE" is undefined
__USING_NAMESPACE_STD(FILE)
^
/usr/include/stdio.h(62): error: expected a "{"
typedef struct _IO_FILE __FILE;
^
/usr/include/wchar.h(76): error: identifier "wint_t" is undefined
wint_t __wch;
^
/usr/include/wchar.h(79): error #77: this declaration has no storage
class or type specifier
} __mbstate_t;
^
/usr/include/_G_config.h(29): error: variable "__mbstate_t" is not a
type name
__mbstate_t __state;
^
/usr/include/_G_config.h(34): error: variable "__mbstate_t" is not a
type name
__mbstate_t __state;
^
/usr/include/gconv.h(158): error: variable "__mbstate_t" is not a type
name
__mbstate_t *__statep;
^
/usr/include/gconv.h(159): error: variable "__mbstate_t" is not a type
name
__mbstate_t __state; /* This element must not be used
directly by
^
/usr/include/libio.h(405): error: identifier "wint_t" is undefined
extern _IO_wint_t __wunderflow (_IO_FILE *) __THROW;
^
/usr/include/libio.h(406): error: identifier "wint_t" is undefined
extern _IO_wint_t __wuflow (_IO_FILE *) __THROW;
^
/usr/include/libio.h(407): error: identifier "wint_t" is undefined
extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;
^
/usr/include/libio.h(407): error: identifier "wint_t" is undefined
extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;
^
and so on.
What's wrong? |
|
Back to top |
|
 |
KBAKEP n00b


Joined: 07 Dec 2002 Posts: 58 Location: Russia
|
Posted: Fri Dec 27, 2002 10:11 am Post subject: Does anybody know? |
|
|
Is it problem of glibc or what?
Any suggestions? |
|
Back to top |
|
 |
Zadeh Tux's lil' helper

Joined: 31 Oct 2002 Posts: 131
|
Posted: Sat Dec 28, 2002 7:03 am Post subject: |
|
|
You have provided insufficient information for anyone to be able to tell you whats wrong. Most likely, your program is just plain incorrect. |
|
Back to top |
|
 |
KBAKEP n00b


Joined: 07 Dec 2002 Posts: 58 Location: Russia
|
Posted: Sat Dec 28, 2002 11:04 am Post subject: Why? |
|
|
My programms worked perfectly 1 month ago (from that time I haven't compiled my progs). A make emerge rsync every weekend. A have only stable official packages. Only root I compiled with icc by myself (and it works for now).
The following code gives the same beginning of errors:
Code: |
#include <iostream.h>
main()
{
cout << "Hello, World!\n";
return 0;
}
|
Of course I tried to re-emerge icc.
What extra info do you need  |
|
Back to top |
|
 |
pilla Bodhisattva


Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Sat Dec 28, 2002 9:47 pm Post subject: |
|
|
can you compile it with g++? _________________ "I'm just very selective about the reality I choose to accept." -- Calvin |
|
Back to top |
|
 |
Zadeh Tux's lil' helper

Joined: 31 Oct 2002 Posts: 131
|
Posted: Sat Dec 28, 2002 11:17 pm Post subject: Re: Why? |
|
|
I wouldn't be surprised if one month ago you were using a different compiler. :)
Your code should look like:
Code: |
#include <iostream>
int main()
{
std::cout << "Hello, World!\n";
return 0;
}
|
Which compiles fine with icc 7.0 and g++ 3.2.1 over here. icc is sometimes more strict by default in what it accepts as legal. |
|
Back to top |
|
 |
pilla Bodhisattva


Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Sat Dec 28, 2002 11:51 pm Post subject: Re: Why? |
|
|
There is another way, setting the std so you don't need to change every cout. (I don't remember it right now, I usually code in C)
Zadeh wrote: | I wouldn't be surprised if one month ago you were using a different compiler.
Your code should look like:
Code: |
#include <iostream>
int main()
{
std::cout << "Hello, World!\n";
return 0;
}
|
Which compiles fine with icc 7.0 and g++ 3.2.1 over here. icc is sometimes more strict by default in what it accepts as legal. |
_________________ "I'm just very selective about the reality I choose to accept." -- Calvin |
|
Back to top |
|
 |
fathergrief n00b

Joined: 04 Oct 2002 Posts: 35 Location: Alaska
|
Posted: Sat Dec 28, 2002 11:54 pm Post subject: |
|
|
Quote: | There is another way, setting the std so you don't need to change every cout. | Put this in your code Code: | using namspace std; |
|
|
Back to top |
|
 |
Zadeh Tux's lil' helper

Joined: 31 Oct 2002 Posts: 131
|
Posted: Sun Dec 29, 2002 12:59 am Post subject: |
|
|
Yeah, the problem is that cout isn't visible. Adding a "using namespace std" at file scope will bring the whole standard namespace into the picture, but that might be overkill for larger programs. A "using std::cout" at file scope would just bring in cout. |
|
Back to top |
|
 |
KBAKEP n00b


Joined: 07 Dec 2002 Posts: 58 Location: Russia
|
Posted: Tue Jan 14, 2003 2:24 pm Post subject: Sorry for delay. |
|
|
System is up-to-date, stable.
g++ compiles
Code: |
#include <iostream>
int main()
{
std::cout << "Hello, World!\n";
return 0;
}
|
and
Code: |
using namespace std;
#include <iostream>
int main()
{
cout << "Hello, World!\n";
return 0;
}
|
But this
Code: |
#include <iostream>
int main()
{
cout << "Hello, World!\n";
return 0;
}
|
doesn't.
icc doesn't work with any code above. Version of icc is 6.0.
It wrties:
Code: |
test.C(1):error: name must be a namespace name
using namespace std;
^
|
BTW, why not 7.0 in stable release  |
|
Back to top |
|
 |
Starfox Tux's lil' helper


Joined: 04 Sep 2002 Posts: 93
|
Posted: Tue Jan 14, 2003 3:26 pm Post subject: |
|
|
Sorry for asking something stupid, but are you sure you compiled your C++ program with icpc and NOT with icc
( the icc is the C, the icpc the C++ compiler from intel!) |
|
Back to top |
|
 |
KBAKEP n00b


Joined: 07 Dec 2002 Posts: 58 Location: Russia
|
Posted: Tue Jan 14, 2003 4:18 pm Post subject: |
|
|
Starfox wrote: | Sorry for asking something stupid, but are you sure you compiled your C++ program with icpc and NOT with icc
( the icc is the C, the icpc the C++ compiler from intel!) |
Everything was OK before upgrade at that time. icc worked perfectly with C++ code.
P.S. Anyway, changing to icpc doesn't help. |
|
Back to top |
|
 |
Zadeh Tux's lil' helper

Joined: 31 Oct 2002 Posts: 131
|
Posted: Tue Jan 14, 2003 4:29 pm Post subject: |
|
|
Quote: |
#include <iostream>
int main()
{
cout << "Hello, World!\n";
return 0;
}
|
cout is undefined there. If icc 6 accepts it, you just got lucky - icc 7 doesn't. That icc 6 is the default choice is probably just an oversight. |
|
Back to top |
|
 |
|