473,396 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

qualified name is not allowed

using namespace std;

typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
} trMessageDataForMethodResult;

class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
};

I am using RVCT compiler( ARM )

May 15 '07 #1
12 22941
I forgot to paste the problem,
While executing following code( I have removed code that Im not
suppossed to post).I am getting the error as qualified name is not
allowed at the line where an object of auto_ptr is declared.Can some
tell me what is the problem
On May 15, 2:43 pm, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;

typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;

} trMessageDataForMethodResult;

class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;

};

I am using RVCT compiler( ARM )

May 15 '07 #2
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;

typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;

} trMessageDataForMethodResult;

class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;

};

I am using RVCT compiler( ARM )
I don't know if this is the problem (since my slightly modified
version compiles just fine on VC++8) but in C++ you normally declare a
struct like this:

struct Name
{
int members;
};

with no typedefs.

--
Erik Wikström

May 15 '07 #3
On May 15, 3:03 pm, Erik Wikström <eri...@student.chalmers.sewrote:
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;
typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
} trMessageDataForMethodResult;
class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
};
I am using RVCT compiler( ARM )

I don't know if this is the problem (since my slightly modified
version compiles just fine on VC++8) but in C++ you normally declare a
struct like this:

struct Name
{
int members;

};

with no typedefs.

--
Erik Wikström
I have also tried changing the structure declatration. but it didnt
worked

May 15 '07 #4
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;

typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;

} trMessageDataForMethodResult;

class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;

};

I am using RVCT compiler( ARM )
I don't have an answer, but the only problem (from a legal point of
view) I can see with this code is the use of a reserved name for the
struct. I assume that tU16 and tU32 are proper names.
Well... right now I see that you haven't qualified auto_ptr. Don't you
believe that this should be std::auto_ptr?

/Peter

May 15 '07 #5
hyderabadblues wrote:
On May 15, 3:03 pm, Erik Wikström <eri...@student.chalmers.sewrote:
>On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
>>using namespace std;
>>typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
>>} trMessageDataForMethodResult;
>>class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
This is a reserved identifier. You're not supposed to use it.
>>
>>};
>>I am using RVCT compiler( ARM )

I don't know if this is the problem (since my slightly modified
version compiles just fine on VC++8) but in C++ you normally declare
a struct like this:

struct Name
{
int members;

};

with no typedefs.

--
Erik Wikström

I have also tried changing the structure declatration. but it didnt
worked
FAQ 5.8. Please read it. You will understand (hopefully) why we
do not like to guess [whether you included <memory>, whether you
have other macros that change the actual code, etc.]

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 15 '07 #6
peter koch wrote:
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
>using namespace std;

typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;

} trMessageDataForMethodResult;

class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;

};

I am using RVCT compiler( ARM )

I don't have an answer, but the only problem (from a legal point of
view) I can see with this code is the use of a reserved name for the
struct. I assume that tU16 and tU32 are proper names.
Well... right now I see that you haven't qualified auto_ptr. Don't you
believe that this should be std::auto_ptr?
I am guessing you didn't see the "using" directive up on top...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 15 '07 #7
hyderabadblues wrote:
using namespace std;

typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
} trMessageDataForMethodResult;

class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
};

I am using RVCT compiler( ARM )
auto_ptr is used in the context of RAII, in this case there is no
resource allocated and acquired at all. I would check if that's the
cause of the error you see.
May 15 '07 #8
On May 15, 9:11 am, hyderabadblues <sirishku...@gmail.comwrote:
On May 15, 3:03 pm, Erik Wikström <eri...@student.chalmers.sewrote:
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;
typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
} trMessageDataForMethodResult;
class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
};
I am using RVCT compiler( ARM )
I don't know if this is the problem (since my slightly modified
version compiles just fine on VC++8) but in C++ you normally declare a
struct like this:
struct Name
{
int members;
};
with no typedefs.
--
Erik Wikström

I have also tried changing the structure declatration. but it didnt
worked
First, auto_ptr doesn't exist, you need to #include <memoryand then
use std::auto_ptr.
Then, any identifier that uses an underscore + a capital letter is
implementation reserved.
So _MessageDataForMethodResultExecuteTest is just begging for
problems.

See if you can follow the following code as a guide:

#include <iostream>
#include <memory>

struct N
{
N(int n) : m_n(n) { std::cout << "N()\n"; }
~N() { std::cout << "~N()\n"; }
int get() const { return m_n; }
private:
int m_n;
};

class Test
{
std::auto_ptr< N ap;
public:
Test(int r) : ap( new N(r) )
{
std::cout << "Test()\n";
}
~Test() { std::cout << "~Test()\n"; }
int get() const { return ap->get(); }
private:
Test(const Test& copy); // disabled
};

int main()
{
Test instance(99);
std::cout << instance.get() << std::endl;
}

/*
N()
Test()
99
~Test()
~N()
*/

May 15 '07 #9
On May 15, 3:59 pm, peter koch <peter.koch.lar...@gmail.comwrote:
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;
typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
} trMessageDataForMethodResult;
class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
};
I am using RVCT compiler( ARM )

I don't have an answer, but the only problem (from a legal point of
view) I can see with this code is the use of a reserved name for the
struct. I assume that tU16 and tU32 are proper names.
Well... right now I see that you haven't qualified auto_ptr. Don't you
believe that this should be std::auto_ptr?

/Peter
I have an initial declaration using namespace std

May 15 '07 #10
On 15 Maj, 16:01, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
peter koch wrote:
On 15 Maj, 14:43, hyderabadblues <sirishku...@gmail.comwrote:
using namespace std;
I don't have an answer, but the only problem (from a legal point of
view) I can see with this code is the use of a reserved name for the
struct. I assume that tU16 and tU32 are proper names.
Well... right now I see that you haven't qualified auto_ptr. Don't you
believe that this should be std::auto_ptr?

I am guessing you didn't see the "using" directive up on top...
You guessed right ;-)
V
May 15 '07 #11
On May 15, 4:02 pm, Fei Liu <fei...@aepnetworks.comwrote:
hyderabadblues wrote:
using namespace std;
typedef struct
{
tU16 u16AppID;
tU16 u16RegisterID;
tU16 u16CmdCounter;
tU16 u16FunctionID;
tU16 u16SourceSubID;
tU32 u32InternalData;
} trMessageDataForMethodResult;
class ExecuteTest
{
auto_ptr< trMessageDataForMethodResult >
_MessageDataForMethodResultExecuteTest;
};
I am using RVCT compiler( ARM )

auto_ptr is used in the context of RAII, in this case there is no
resource allocated and acquired at all. I would check if that's the
cause of the error you see.
It is a member variable, I will initialize it in the actual class
definition.

May 15 '07 #12

"hyderabadblues" <si*********@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
>>
using namespace std;
>/Peter

I have an initial declaration using namespace std
Not related to your problem, but if this is in a header file, then it's not
a great idea to do that. You're forcing every file that uses this header to
bring in the entire std namespace. It's preferred to either use
"std::auto_ptr", or to use "using std::auto_ptr".

-Howard

May 15 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: C. M. Sperberg-McQueen | last post by:
wooks (wookiz@hotmail.com) wrote: > <?xml version='1.0'?> > <userlogin xmlns="urn:faster:userlogin" > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <login>mick</login> > ...
4
by: Jim Garrison | last post by:
I know how to use the name() function to access the name of the current node. How do I get the 'fully qualified' name, consisting of the path from the root to the current node? I.e. <a> <b>...
6
by: Martin | last post by:
Hi, I have a xml file like the one below <?xml version="1.0" encoding="utf-8"?><e1 xmlns:e1="http://tempuri.org/Source1.xsd" e1:att1="1" e1:att2="2" e1:rest="345"/> If I try to create a...
0
by: Ali | last post by:
Hello, I have written a utility in C# using ODBC.NET. It can fetch information from a ODBC supported database table and copy it to the other ODBC supported DB table; provided the tables exist on...
4
by: Aashish Patil | last post by:
Hello, Is it possible to obtain the fully qualified name of a class in c#. What I am looking for is something analogous to Box.class.getName() that exists in Java. Its possible to get this by...
5
by: fc2 | last post by:
Hi I have a problem with fully qualified names. According to the C# language specification: "Every namespace and type has a fully qualified name, which uniquely identifies the namespace or...
1
by: KK | last post by:
Two quick questions: 1.) Given only a string containing fully qualified type name (e.g. "System.Drawing.Rectangle"), is there a consistent way to get the Type object that the string corresponds...
5
by: Simon Brooke | last post by:
The documentation for org.w3c.dom.DOMImplementation.createDocumentType says helpfully: public DocumentType createDocumentType(java.lang.String qualifiedName, java.lang.String publicId,...
11
by: John Brown | last post by:
Hi there, Does anyone know how to extract the full type name ("namespace.type") from an assembly qualified name. Thanks.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.