cpunion / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
1 stars 0 forks source link

Linker Compile Error Hello world #117

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. build the toolchain and try to compile hello world

What is the expected output? What do you see instead?
compiled hello world,

/usr/local/bin/arm-apple-darwin-ld: Undefined symbols:
.objc_class_name_HelloApplication
.objc_class_name_NSAutoreleasePool
_UIApplicationMain
_objc_msgSend
collect2: ld returned 1 exit status

What version of the product are you using? On what operating system?
debian etch

Please provide any additional information below.
 here is the error

/usr/local/bin/arm-apple-darwin-ld: Undefined symbols:
.objc_class_name_HelloApplication
.objc_class_name_NSAutoreleasePool
_UIApplicationMain
_objc_msgSend
collect2: ld returned 1 exit status

Original issue reported on code.google.com by david.m....@gmail.com on 5 Feb 2008 at 9:24

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
here is the error when i try to compile hello.m
TheCrapTop:/home/davo/c/iphone-c/new# arm-apple-darwin-cc hello.m
/usr/local/bin/arm-apple-darwin-ld: Undefined symbols:
.objc_class_name_HelloApplication
.objc_class_name_NSAutoreleasePool
_UIApplicationMain
_objc_msgSend
collect2: ld returned 1 exit status

Original comment by david.m....@gmail.com on 6 Feb 2008 at 10:56

GoogleCodeExporter commented 8 years ago
I'm also getting the same Undefined symbols errors. I built the open toolchain 
on my Mac Leopard machine 
from instructions Zdziarski's new "iPhone Open Application Development" 
O'Reilly book. A standard C++ 
HelloWorld program compiles and links fine, and even runs on the iPhone. I 
attached "gcc -v" output in case 
that helps.

HEAVENLY=/usr/local/share/iphone-filesystem ; 
LLVMOBJDIR=/Users/admin/src/llvm-svn ; arm-apple-
darwin-gcc -v -o MyExample MyExample.m SimpleWebView.m -lobjc -framework 
CoreFoundation -
framework Foundation

Thanks to anyone who can point me in the right direction.

I'm also confused why I get this warning. I did export 
FLAGS_FOR_TARGET="-mmacosx-version-min=10.1" 
as described in book.

/usr/local/bin/arm-apple-darwin-ld: warning unknown -macosx_version_min 
parameter value: 10.5.2 
ignored (using 10.1)

Original comment by Jamshi...@gmail.com on 9 Apr 2008 at 9:08

Attachments:

GoogleCodeExporter commented 8 years ago
In my case the solution was to  add "-framework UIKit". Don't know if that was 
needed for the sample app I 
was trying to compile, or if that should be a default, or if something is wrong 
with my toolchain build. The 
book just says "-framework CoreFoundation -framework Foundation" is needed.

I also had to edit /usr/local/arm-apple-darwin/include/UIKit/UIWebView.h to 
remove an import and add 
another, and to comment out "<UIFormControl>".

/*!!!#import "UIKeyboardInputProtocol.h"*/
#import <UIKit/UIKeyboardInput.h>
...
      DOMNode/*!!!<UIFormControl>*/ *element;

Original comment by Jamshi...@gmail.com on 10 Apr 2008 at 2:42

GoogleCodeExporter commented 8 years ago
Very similar error happens on my MacBook with Leopard.
I compiled the toolchain as described on 
http://wikee.iphwn.org/howto:toolchain_on_leopard_aspen 

I have attached the errors as textfile.

Original comment by ben.psy...@googlemail.com on 21 Jul 2008 at 11:21

Attachments:

GoogleCodeExporter commented 8 years ago
Hi ben, to remove errors about missing references from _libgcc, you can use 
these 
flags for linker:
LDFLAGS = \
        -framework CoreFoundation       \
        -framework Foundation   \
        -framework UIKit        \
        -framework CoreGraphics \
        -L/usr/local/share/iphone-filesystems/usr/lib/  \
        -L/usr/local/arm-apple-darwin/lib       \
        -F/usr/local/share/iphone-filesystems/System/Library/Frameworks \
        -F/usr/local/share/iphone-filesystems/System/Library/PrivateFrameworks \
        -lobjc -lSystem.B -lgcc_s.1 -lstdc++.6

I follow your same link to compile my toolchain. Now still erros about 
missing .objc_ references :(

Bye,
Salvatore

Original comment by ans...@gmail.com on 7 Aug 2008 at 4:47