Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

icc compiling problem.

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
KBAKEP
n00b
n00b
User avatar
Posts: 58
Joined: Sat Dec 07, 2002 2:56 pm
Location: Russia

icc compiling problem.

  • Quote

Post by KBAKEP » Wed Dec 25, 2002 9:17 am

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?
Top
KBAKEP
n00b
n00b
User avatar
Posts: 58
Joined: Sat Dec 07, 2002 2:56 pm
Location: Russia

Does anybody know?

  • Quote

Post by KBAKEP » Fri Dec 27, 2002 10:11 am

Is it problem of glibc or what?
Any suggestions?
Top
Zadeh
Tux's lil' helper
Tux's lil' helper
Posts: 131
Joined: Thu Oct 31, 2002 5:51 am

  • Quote

Post by Zadeh » Sat Dec 28, 2002 7:03 am

You have provided insufficient information for anyone to be able to tell you whats wrong. Most likely, your program is just plain incorrect.
Top
KBAKEP
n00b
n00b
User avatar
Posts: 58
Joined: Sat Dec 07, 2002 2:56 pm
Location: Russia

Why?

  • Quote

Post by KBAKEP » Sat Dec 28, 2002 11:04 am

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: Select all

#include <iostream.h>

main()
{
   cout << "Hello, World!\n";
   return 0;
}
Of course I tried to re-emerge icc.

What extra info do you need :?:
Top
pilla
Bodhisattva
Bodhisattva
User avatar
Posts: 7732
Joined: Wed Aug 07, 2002 8:19 pm
Location: Underworld

  • Quote

Post by pilla » Sat Dec 28, 2002 9:47 pm

can you compile it with g++?
"I'm just very selective about the reality I choose to accept." -- Calvin
Top
Zadeh
Tux's lil' helper
Tux's lil' helper
Posts: 131
Joined: Thu Oct 31, 2002 5:51 am

Re: Why?

  • Quote

Post by Zadeh » Sat Dec 28, 2002 11:17 pm

I wouldn't be surprised if one month ago you were using a different compiler. :)

Your code should look like:

Code: Select all

#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.
Top
pilla
Bodhisattva
Bodhisattva
User avatar
Posts: 7732
Joined: Wed Aug 07, 2002 8:19 pm
Location: Underworld

Re: Why?

  • Quote

Post by pilla » Sat Dec 28, 2002 11:51 pm

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: Select all

#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
Top
fathergrief
n00b
n00b
Posts: 35
Joined: Fri Oct 04, 2002 4:38 pm
Location: Alaska

  • Quote

Post by fathergrief » Sat Dec 28, 2002 11:54 pm

There is another way, setting the std so you don't need to change every cout.
Put this in your code

Code: Select all

using namspace std;
Top
Zadeh
Tux's lil' helper
Tux's lil' helper
Posts: 131
Joined: Thu Oct 31, 2002 5:51 am

  • Quote

Post by Zadeh » Sun Dec 29, 2002 12:59 am

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.
Top
KBAKEP
n00b
n00b
User avatar
Posts: 58
Joined: Sat Dec 07, 2002 2:56 pm
Location: Russia

Sorry for delay.

  • Quote

Post by KBAKEP » Tue Jan 14, 2003 2:24 pm

System is up-to-date, stable.
g++ compiles

Code: Select all

#include <iostream>

int main()
{
   std::cout << "Hello, World!\n";
   return 0;
}
and

Code: Select all

using namespace std;
#include <iostream>

int main()
{
   cout << "Hello, World!\n";
   return 0;
}
But this

Code: Select all

#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: Select all

test.C(1):error: name must be a namespace name
    using namespace std;
                    ^
BTW, why not 7.0 in stable release :?:
Top
Starfox
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 93
Joined: Wed Sep 04, 2002 6:56 am

  • Quote

Post by Starfox » Tue Jan 14, 2003 3:26 pm

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!)
Top
KBAKEP
n00b
n00b
User avatar
Posts: 58
Joined: Sat Dec 07, 2002 2:56 pm
Location: Russia

  • Quote

Post by KBAKEP » Tue Jan 14, 2003 4:18 pm

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.
Top
Zadeh
Tux's lil' helper
Tux's lil' helper
Posts: 131
Joined: Thu Oct 31, 2002 5:51 am

  • Quote

Post by Zadeh » Tue Jan 14, 2003 4:29 pm

#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.
Top
Post Reply

13 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic