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

Odd error message...

I am trying to figure out why I am getting this error:

I define a type in a header file. I include that file.
typedef struct x * xref;

I include it in my class

class myclass
{
xref xr;
};

I compile and get the error message:

error: 'xref' is used as a type, but is not defined as a type.

What is this?

Aug 30 '07 #1
3 1504
SpreadTooThin wrote:
I am trying to figure out why I am getting this error:

I define a type in a header file. I include that file.
typedef struct x * xref;

I include it in my class

class myclass
{
xref xr;
};

I compile and get the error message:

error: 'xref' is used as a type, but is not defined as a type.
Several possibilities. One, you claim to include that file,
but inclusion has no effects due to duplicate inclusion guards
(or other conditional compilation directive); solution -- make
your compiler output the preprocessing results and confirm you
actually have the definition of 'xref' in the scope. Two, how
is 'x' defined? Could it be it's a macro of sorts that screws
up the 'typedef' statement?

Anyway, read the FAQ 5.8 and follow its recommendations.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 30 '07 #2
>
error: 'xref' is used as a type, but is not defined as a type.

Several possibilities. One, you claim to include that file,
but inclusion has no effects due to duplicate inclusion guards
(or other conditional compilation directive); solution -- make
your compiler output the preprocessing results and confirm you
actually have the definition of 'xref' in the scope.
Ok...
# 2762 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 3
typedef struct OpaqueIOBluetoothDeviceInquiryRef *
IOBluetoothDeviceInquiryRef;

Two, how is 'x' defined? Could it be it's a macro of sorts that screws
up the 'typedef' statement?
To be more accurate:

# 2762 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 3
typedef struct OpaqueIOBluetoothDeviceInquiryRef *
IOBluetoothDeviceInquiryRef;

I can find no other refrence to OpaqueIOBlueToothDeviceInquiryRef....
Anyway, read the FAQ 5.8 and follow its recommendations.
I Shall..

I also seem to be having issues with 'C' methods and defines...

extern "C" {
# 1 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 1 3

Yet the linker is saying:

bluetoothcontrol.cpp:56: error:
`IOBluetoothDeviceInquiryCreateWithCallbackRefCon' is not available
(declared at /Users/me/Desktop/development/plugins/bluetoothcontrol
bluetoothcontrol.cpp:52)

Tool:0: __Z48IOBluetoothDeviceInquiryCreateWithCallbackRef ConPv

Checking the .i file:
# 2843 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 3
extern IOBluetoothDeviceInquiryRef
IOBluetoothDeviceInquiryCreateWithCallbackRefCon( void *
inUserRefCon ) __attribute__((unavailable));

Aug 30 '07 #3
SpreadTooThin wrote:
>>error: 'xref' is used as a type, but is not defined as a type.

Several possibilities. One, you claim to include that file,
but inclusion has no effects due to duplicate inclusion guards
(or other conditional compilation directive); solution -- make
your compiler output the preprocessing results and confirm you
actually have the definition of 'xref' in the scope.

Ok...
# 2762 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 3
typedef struct OpaqueIOBluetoothDeviceInquiryRef *
IOBluetoothDeviceInquiryRef;

>Two, how is 'x' defined? Could it be it's a macro of sorts that
screws up the 'typedef' statement?

To be more accurate:

# 2762 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 3
typedef struct OpaqueIOBluetoothDeviceInquiryRef *
IOBluetoothDeviceInquiryRef;

I can find no other refrence to OpaqueIOBlueToothDeviceInquiryRef....
Which suggests that 'OpaqueIOBluetoothDeviceInquiryRef' is declared
*right here* as a struct and a pointer to it is typedef'ed here,
*but* if it is not defined anywhere any attempt to dereference the
pointer would fail.

Check this out:

struct Blah;
typedef Blah *BlahPtr; // perfectly fine

class Foo {
BlahPtr ptr;
public:
Foo(BlahPtr p) : ptr(p) { ptr->doSomething(); } // error
};

struct Blah { void doSomething() {} };

int main() {
Blah blah;
Foo foo(&blah);
}

--------------------------------------- If I rewrite to have the
body of the Foo's c-tor after the definition of 'Blah', it should
be alright:

struct Blah;
typedef Blah *BlahPtr;

class Foo {
BlahPtr ptr;
public:
Foo(BlahPtr p); //
};

struct Blah { void doSomething() {} };

Foo::Foo(BlahPtr p) : ptr(p) { ptr->doSomething(); }

int main() {
Blah blah;
Foo foo(&blah);
}
===========================

Perhaps you were supposed to include some other header to provide
the definition of 'OpaqueIOBluetoothDeviceInquiryRef'...

Try RTFM.
>
>Anyway, read the FAQ 5.8 and follow its recommendations.

I Shall..

I also seem to be having issues with 'C' methods and defines...

extern "C" {
# 1 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 1 3

Yet the linker is saying:

bluetoothcontrol.cpp:56: error:
`IOBluetoothDeviceInquiryCreateWithCallbackRefCon' is not available
(declared at /Users/me/Desktop/development/plugins/bluetoothcontrol
bluetoothcontrol.cpp:52)

Tool:0: __Z48IOBluetoothDeviceInquiryCreateWithCallbackRef ConPv

Checking the .i file:
# 2843 "/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
IOBluetooth.framework/Headers/IOBluetoothUserLib.h" 3
extern IOBluetoothDeviceInquiryRef
IOBluetoothDeviceInquiryCreateWithCallbackRefCon( void *
inUserRefCon ) __attribute__((unavailable));
"__attribute__((unavailable))" -- you're beyond the Standard C++
territory. Perhaps asking about this thing in a MacOS newsgroup
would help...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 30 '07 #4

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

Similar topics

10
by: | last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by...
9
by: Mairhtin O'Feannag | last post by:
Hello, We have two machines we wish to use DPF. They are both RH ES 2.1, with DB2 8.2. I read the documentation CAREFULLY, and added the following line to my db2nodes.cfg file : 1 egret 0
6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
10
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an...
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
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: 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
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.