• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: error: conflicting type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error: conflicting type


  • Subject: Re: error: conflicting type
  • From: Cameron Hayne <email@hidden>
  • Date: Tue, 28 Jun 2005 14:42:57 -0400

On 28-Jun-05, at 8:16 AM, sujeeshlal wrote:

I am newable in Mac Os. 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'

It is somewhat unusual to use OS X specific code like Carbon and ApplicationServices in a "port". You should be able to get the program working with relatively small changes given that it will retain its X11 user-interface.


But if you really need to have the headers included all in the same file, you could use the standard trick of #define-ing one of the conflicting symbols to be something different.
E.g.:
#define Cursor X11_Cursor
#include <X11/X11.h>
#undef Cursor


and then use "X11_Cursor" in your code if you need the X11 Cursor type.

--
Cameron Hayne
email@hidden


_______________________________________________ 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
  • Follow-Ups:
    • Re: error: conflicting type
      • From: "sujeeshlal" <email@hidden>
References: 
 >error: conflicting type (From: "sujeeshlal" <email@hidden>)

  • Prev by Date: Re: how to use .dylib with typelibs under Excel mac - how to build under Xcode ?
  • Next by Date: Re: error: conflicting type
  • Previous by thread: error: conflicting type
  • Next by thread: Re: error: conflicting type
  • Index(es):
    • Date
    • Thread