RE: extern C and static data type problem with g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luu!
enum in C&C++ is something like #define in the sence 
of memory allocating. Nothing is allocated for #define and for enum as well.
The difference is #define is resolved in preprocessor time, when 
enum tokens follow the scope rules (class, namespace) and do exist 
at compile time.
Sorry for my English :( 

----
Lev Assinovsky
Aelita Software Corporation 
(now is a part of Quest Software)
O&S InTrust Framework Division, Team Leader
ICQ# 165072909


> -----Original Message-----
> From: Luu Vo [mailto:vtluu@xxxxxxxxxx]
> Sent: Tuesday, April 27, 2004 1:14 PM
> To: gcc-help@xxxxxxxxxxx
> Subject: extern C and static data type problem with g++
> 
> 
> In RH Linux 9, when compiling my C++ program with lines as below:
> 
> extern "C" struct {int x};
> static enum E{A=0, B, C};
> 
> g++ said:
> 
> storage class specified for field `x'
> `static' can only be specified for objects and functions
> 
> Is this just the implementation of g++? That means I can't 
> use static and
> extern "C" for those lines of code?
> 
> Another question: with GNU g++/gcc compiler and its C++ 
> library, can I use
> both traditional C++ lib (e.g., classic iostream) and standard C++ lib
> (e.g., standard iostream) in my C++ program. Are the both libraries
> implemented in glibstdc++?
> 
> Any help will be appreciated.
> 
> Luu Vo.
> 
> 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux