Re: error: conflicting type
Re: error: conflicting type
- Subject: Re: error: conflicting type
- From: Mark Bessey <email@hidden>
- Date: Tue, 28 Jun 2005 11:44:28 -0700
On Jun 28, 2005, at 5:16 AM, sujeeshlal wrote: I have tried to port my Linux application to MAC using XCode. In my project I used some Xlib functions . But when I tried to include #include <ApplicationServices/ApplicationServices.h> #include <Carbon/Carbon.h> to my existing file which also contains #include <X11/Xlib.h> it shows some errors like error:conflicting type for 'struct Cursor' error: previous declaration as 'typedef XID Cursor' . How can I rectify this error.. Is that not possible to include Xlib.h and ApplicationServices.h at same time. I need both of this file.
In general, you're not going to be able to #include both Xlib.h and ApplicationServices.h in the same file. They conflict in a number of places. I'm curious why you think that you need both headers in the same file. Much of the functionality that's provided by Carbon and ApplicationServices is already provided by X11, and vice-versa.
If you want to use a subset of Carbon, you'd be better off just #including the minimal set of headers that define the API you're using. Take a look at the headers that Carbon.h and ApplicationServices.h include, and only include the ones you need.
Alternatively, you can put all the Mac-specific code in a single .c file, and call into it from your other routines. That way the #includes in that file can just be the Mac-specific headers...
-Mark |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden