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 ) 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 )
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
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
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
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
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
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.
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()
*/
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
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
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.
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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>
> ...
|
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>...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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.
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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,...
|
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...
|
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...
| |