[TxMt] Re: Problem with imported files in Objective-C

Allan Odgaard mailinglist at textmate.org
Thu Oct 20 10:48:37 UTC 2011


On 19 Oct 2011, at 13:34, Nevan King wrote:

> […] I want to use separate files […] the error it gives:

When you use multiple files you effectively need a build system.

A build system compiles each file individually into an object file and then link the object files together into an executable.

Since TextMate doesn’t know what objects your executable may need (based on the current file) it can’t easily have ⌘R do all this for you.

It’s also common to include other steps as part of the building process, like copying resources, preprocessing files, etc.

> […] I looked at the Xcode bundle, which also has a "Run" command, but it
> seems to require an Xcode project to work.

The Xcode bundle is simply a frontend for running “xcodebuild”, which uses Xcode’s proprietary build system.

> Is there a way to get my files to link automatically before running? Thanks.

Well, since ⌘R allows you to set additional options via the OBJC_FLAGS variable, it is technically possible to simply add all your files via that variable. When gcc/clang is given multiple files, it will build and link them all.

Another approach is creating a simple Makefile and use ⌘B from the Make bundle. But this require you to learn about make.



More information about the textmate mailing list