Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Jan 2015 18:59:52 +1030
From:      Shane Ambler <BSD@ShaneWare.Biz>
To:        Mayuresh Kathe <mayuresh@kathe.in>, freebsd-questions@freebsd.org
Subject:   Re: working with obj-c under freebsd!
Message-ID:  <54ACEE80.7050706@ShaneWare.Biz>
In-Reply-To: <20150105184832.GA1590@aio.kathe.in>
References:  <20150105160823.GA1080@aio.kathe.in> <20150105175949.GA972@aio.kathe.in> <20150105184133.GA1430@aio.kathe.in> <20150105184832.GA1590@aio.kathe.in>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/01/2015 05:18, Mayuresh Kathe wrote:
> On Tue, Jan 06, 2015 at 12:11:34AM +0530, Mayuresh Kathe wrote:
>> On Mon, Jan 05, 2015 at 11:29:50PM +0530, Mayuresh Kathe wrote:
>>> On Mon, Jan 05, 2015 at 09:38:24PM +0530, Mayuresh Kathe wrote:
>>>> i had asked this question before and was advised to install
>>>> the gnustep framework before trying out obj-c development
>>>> under freebsd.
>>>>
>>>> finally got the whole thing installed and tried to compile
>>>> the following simple objective-c program.
>>>>
>>>> #import <Foundation/Foundation.h>
>>>>
>>>> int main (int argc, const char * argv[])
>>>> {
>>>> 	@autoreleasepool {
>>>> 		NSLog (@"Programming is fun!");
>>>> 	}
>>>> 	return 0;
>>>> }
>>>>
>>>> the compiler options used were as below;
>>>> clang -fobjc-arc main.m -o prog1
>>>>
>>>> the compiler threw up the following error;
>>>> main.m:3:9: fatal error: 'Foundation/Foundation.h' file not found
>>>> #import <Foundation/Foundation.h>
>>>>          ^
>>>> 1 error generated.
>>>>
>>>> what can i do to get the above resolved?
>>>
>>> i found the location of that file to be at;
>>> /usr/local/GNUstep/System/Library/Headers/Foundation/Foundation.h
>>>
>>> should i be pointing the LD_LIBRARY_PATH variable to that point too?
>>> don't know if that would work, gnustep and obj-c do have their own
>>> way of setting things up and getting things done. :)
>>
>> okay, got it to compile and work, find below contents of GNUmakefile;
>> GNUSTEP_MAKEFILES=/usr/local/GNUstep/System/Library/Makefiles
>> include $(GNUSTEP_MAKEFILES)/common.make
>> TOOL_NAME = mainapp
>> mainapp_OBJC_FILES = main.m
>> include $(GNUSTEP_MAKEFILES)/tool.make
>>
>> put it in the same directory as main.m and just issue gmake.
>> remember to edit config.make found at;
>> /usr/local/GNUstep/System/Library/Makefiles/
>> to reflect the actual location of clang tools, i.e. /usr/bin/
>
> also remember to set the environment variable GNUSTEP_SYSTEM_TOOLS to
> point to /usr/local/GNUstep/System/Tools
>
> ~mayuresh

You might want to look at
/usr/local/GNUstep/System/Makefiles/GNUstep.csh
or
/usr/local/GNUstep/System/Makefiles/GNUstep.sh

They read in /usr/local/GNUstep/GNUstep.conf and ~/.GNUstep.conf for 
settings.


-- 
FreeBSD - the place to B...Software Developing

Shane Ambler




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54ACEE80.7050706>