Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: compiling plugins on the mac with Xcode 3


From   [email protected]
To   [email protected], "Tom Trikalinos" <[email protected]>
Subject   Re: st: compiling plugins on the mac with Xcode 3
Date   Wed, 10 Dec 2008 10:15:38 -0600

"Tom Trikalinos" <[email protected]> wrote:

> I welcome advice on how to set up a new project for a Stata plugin in
> Xcode (i'm new to Xcode - but OK with -vi-, -make-, -gcc- and
> -gdb-)... I tried asking for a new "Bundle" or a new "BSD Dynamically
> linked library", but it seems that neither is the case or I am
> neglecting to do something... I get plugins that Stata cannot load
> ("not a Mach-O_MH file").

You want to create the project as a BSD Dynamic Library and change the target
to a bundle.  You could've created a Carbon or Cocoa Bundle project but you
don't need the included frameworks and resources so it's just easier to start
with a minimal project such as the BSD Dynamic Library.

After you've included the source files to the project, open the target
settings for your plugin and change:

Linking
	Compatibility Version		<remove value>
	Current Library Version		<remove value>
	Mach-O Type			Bundle

Packaging
	Executable Extension		plugin
	Executable Prefix		<remove value, optional>

GCC-4.0 Language
	Other C Flags			-DSYSTEM=APPLEMAC
	Other C++ Flags			-DSYSTEM=APPLEMAC

<remove value> means to clear the text field for the setting so that its value
is empty.  If you don't see any GCC-4.0 Language settings, it's because you
haven't added your source files to the project yet.  The Other C++ Flags
setting is automatically set when you set the Other C Flags setting.

These are the only settings that must be changed to build a Stata plugin.
It's up to you whether you want to change any other settings.  I do recommend
that you compile the plugin for all Mac platforms by setting the Architectures
setting to "i386 x86_64 ppc ppc64".  You'll build a single plugin that will
work on any Mac.

-Chinh Nguyen
 [email protected]
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index