PDA

View Full Version : problem when using Makefile for LayerKit framework




d.devendran
Nov 4, 2009, 04:37 AM
Hi experts, I'm newbie for iphone dev, no i'm learning native way to dev, when i'm using the following content in my Makefile as below


DEVICE = 192.168.1.15
APPL = MyApp

DOTH = MyApp.h
OBJS = main.o MyApp.o

SDK = /Developer/Platforms/iPhoneOS.platform/Developer
ARCH = armv6
SYSROOT= $(SDK)/SDKs/iPhoneOS2.2.sdk

CC = $(SDK)/usr/bin/arm-apple-darwin9-gcc-4.0.1 \
-arch $(ARCH) -isysroot $(SYSROOT)
CFLAGS = -std=c99 -Werror -I$(SDK)/usr/include/gcc/darwin/4.0

LD = $(CC)
LDFLAGS =\
-framework UIKit\
-framework CoreFoundation\
-framework Foundation\
-framework CoreGraphics\
-framework LayerKit\
-lobjc\
-bind_at_load

$(APPL): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^
cp $(APPL) $(APPL).app
@chmod 755 $(APPL).app/$(APPL)
@touch $(APPL).app

%.o: %.m $(DOTH)
$(CC) $(CFLAGS) -c $<


install: $(APPL)
@ssh root@$(DEVICE) /bin/rm -f /Applications/$(APPL).app/$(APPL)
scp -r $(APPL).app root@$(DEVICE):/Applications
ssh root@$(DEVICE) /usr/bin/ldid -S /Applications/$(APPL).app/$(APPL)

i'm getting error as :
ld: framework not found LayerKit
collect2: ld returned 1 exit status

but when i remove '-framework LayerKit\ ' in the LDFLAGS, its working ok, can anyone help me

thanks



kainjow
Nov 4, 2009, 07:00 PM
I believe LayerKit was the name of Core Animation originally, but then they changed it. The framework you want is QuartzCore.

d.devendran
Nov 6, 2009, 01:43 AM
thanks bro, ur correct now its using QuartzCore

d.devendran
Nov 6, 2009, 03:04 AM
i try with below code;

the below declare in .h file
-------------------------
UIPushButton *markButton;
CGColorSpaceRef colorSpace;

the below is in .m file
--------------------
markButton = [[UIPushButton alloc] initWithFrame:CGRectMake(60.0,29.0,106.0,30.0)];
[markButton[b] setAutosizesToFit:NO];
[markButton[b] setShowPressFeedback:YES];
[markButton[b] setTitle:@"new game"];
[markButton setTitleColor:CGColorCreate(colorSpace,white) forState:0];


when compile, i'm getting error as below,

cc1obj: warnings being treated as errors
apview.m: In function '-[APView initWithFrame:ownedBy:]':
apview.m:59: warning: receiver 'UIColor' is a forward class and corresponding @interface may not exist
apview.m:59: warning: no '-initWithCGColor:' method found
apview.m:59: warning: (Messages without a matching method signature
apview.m:59: warning: will be assumed to return 'id' and accept
apview.m:59: warning: '...' as arguments.)
apview.m:59: warning: 'UIPushButton' may not respond to '-setTitleColor:'
make: *** [apview.o] Error 1

amorya
Nov 6, 2009, 04:31 AM
I don't believe UIPushButton is a public class. Why are you using that rather than UIButton?

robbieduncan
Nov 6, 2009, 04:47 AM
I don't believe UIPushButton is a public class. Why are you using that rather than UIButton?

Given that he's using Makefiles I assume we are talking jailbroken development here...

PhoneyDeveloper
Nov 6, 2009, 08:55 AM
The cause of that compile error is that the #import for UIColor is missing. I don't see any use of a precompiled header in the make file. There probably should be one. At any rate that source file is missing an #import.