473,378 Members | 1,134 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,378 software developers and data experts.

What is an unqualified-id ?

Hello,
I've searched and searched and cannot seem to figure it out so I was
hoping someone could explain to me exactly what an unqualified-id is?

My compiler is generating this error...
ThreadLibMutex.h:37: error: expected unqualified-id before ')'
token

My line 37 is the top of this constructor...

Mutex(){
#ifdef WIN32
// we use critical sections in Windows
InitializeCriticalSection( &m_mutex );
#else
pthread_mutex_init( &m_mutex, 0 );
#endif
}

The class itself is defined immediately above and consists of....

class Mutex {
protected:
// define the base mutex types
#ifdef WIN32
CRITICAL_SECTION m_mutex;
#else
pthread_mutex_t m_mutex;
#endif
public:
inline void Lock() {
#ifdef WIN32
EnterCriticalSection( &m_mutex );
#else
pthread_mutex_lock( &m_mutex );
#endif
}

inline void Unlock() {
#ifdef WIN32
LeaveCriticalSection( &m_mutex );
#else
pthread_mutex_unlock( &m_mutex );
#endif
}
}; // end class Mutex

I've just never heard of an unqualified-id so I have no idea whats
wrong, but the code is looking perfectly legal to me.
Any advice appreciated, and again, thanks in advance!
Regards,

Oct 20 '06 #1
8 18024
DevNull wrote:
Hello,
I've searched and searched and cannot seem to figure it out so I was
hoping someone could explain to me exactly what an unqualified-id is?

My compiler is generating this error...
ThreadLibMutex.h:37: error: expected unqualified-id before ')'
token

My line 37 is the top of this constructor...

Mutex(){]
I wouldn't be surprised if some Microsoft include file #define's
Mutex to be something.
Oct 20 '06 #2
* DevNull:
Hello,
I've searched and searched and cannot seem to figure it out so I was
hoping someone could explain to me exactly what an unqualified-id is?

My compiler is generating this error...
ThreadLibMutex.h:37: error: expected unqualified-id before ')'
token

My line 37 is the top of this constructor...

Mutex(){
#ifdef WIN32
// we use critical sections in Windows
InitializeCriticalSection( &m_mutex );
#else
pthread_mutex_init( &m_mutex, 0 );
#endif
}
What Ron Natalie said (look out! Microsoft macros everywhere! or, as Dan
Quayle would have said, Microsoft macroes everywhere!), plus, try using
the qualified id

Mutex::Mutex()

;-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Oct 20 '06 #3

<snip>
What Ron Natalie said (look out! Microsoft macros everywhere! or, as Dan
Quayle would have said, Microsoft macroes everywhere!), plus, try using
the qualified id

Mutex::Mutex()

;-)
</snip>

Nope that made things worse...
ThreadLibMutex.h:35: error: definition of implicitly-declared
'Mutex::Mutex()'
ThreadLibMutex.h:35: error: declaration of 'Mutex::Mutex()' throws
different exceptions
ThreadLibMutex.h:9: error: than previous declaration 'Mutex::Mutex()
throw ()'

Line 9 being where the Mutex class is located. Oh and ya can't blame
this one on MS, I'm compiling this code with GCC v4.0.3 it's just
supposed to be a simple little crossplatform wrapper :( If anyone is
interested I can post the complete source. It's only 49 lines of code
in total.

Oct 20 '06 #4
DevNull wrote:
<snip>
>What Ron Natalie said (look out! Microsoft macros everywhere! or, as Dan
Quayle would have said, Microsoft macroes everywhere!), plus, try using
the qualified id

Mutex::Mutex()

;-)
</snip>\
Try sticking #undef Mutex
right before the affected line.

A unqualified id is one without :: in it.

Nothing inside a class definition should have a qualification.
Oct 20 '06 #5
Nope that made things worse...
ThreadLibMutex.h:35: error: definition of implicitly-declared
'Mutex::Mutex()'
ThreadLibMutex.h:35: error: declaration of 'Mutex::Mutex()' throws
different exceptions
ThreadLibMutex.h:9: error: than previous declaration 'Mutex::Mutex()
throw ()'
Listen to your compiler, not the MS bashers.

Declare the constructor in your class definition. . .

Michael

Oct 20 '06 #6
Awesome!
<snip>
Declare the constructor in your class definition. . .
</snip>
Ahhh thank you!
I got it working now.

Oct 20 '06 #7
DevNull wrote:
If anyone is interested I can post the complete source. It's only 49
lines of code in total.
I'd say that would be a great idea.
Oct 20 '06 #8
* DevNull:
<snip>
>What Ron Natalie said (look out! Microsoft macros everywhere! or, as Dan
Quayle would have said, Microsoft macroes everywhere!), plus, try using
the qualified id

Mutex::Mutex()

;-)
</snip>

Nope that made things worse...
ThreadLibMutex.h:35: error: definition of implicitly-declared
'Mutex::Mutex()'
You also need to /declare/ the constructor in the class definition.

Hth.,

- Alf

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Oct 20 '06 #9

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> > ...
13
by: Jerry Manner | last post by:
Hi I have a problem using the location.href("ProductL.htm") javascript code. Using this code on my system ( W98 SE, IE 6.0) is working correctly. But if a user has W2000 IE 5.0 it doesn't work....
9
by: Jiho Han | last post by:
Suppose I have an xml fragment like: <mother> <child name="Bob" sex="M"/> <child name="Jane" sex="F"/> ... </mother> If I wanted to replace the <mother> element to <father> element, what is...
4
by: Erik Moore | last post by:
I am both producing and parsing an xml document that needs to be validated against a schema. I wanted some consumers of the document to have the option of not performing a validation, so I left the...
0
by: Goodmannewz | last post by:
In the textbook, there is a sentence that "Default XML namespaces(xmlns="...") helps a lot, but can also create problems, as a side effect of the rules for automatic qualification. How to...
1
by: Simon | last post by:
Hi - I have a webservice with WSDL specifying 'elementFormDefault' set to 'unqualified'. I find when I try to process the incoming XML the raw XML either looks like this: <s0:rootelement...
3
by: mavis | last post by:
Unqualified element in XSD definition For some reason, we may need to define elements in XSD to be "unqualified". According to the design patterns of XSD, it seems they do not recommend ...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
0
by: Stef Mientki | last post by:
hello, I've syntax error which I totally don't understand: ########## mainfile : import test_upframe2 if __name__ == '__main__': var1 = 33 code = 'print var1 + 3 \n'
0
by: Terry Reedy | last post by:
Stef Mientki wrote: Indendation is screwed. Is the above all do_more body? Which locals does this get you? __init__'s? (locals()?) Isn't this just the same as globals()?
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.