View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017470 | FPC | Compiler | public | 2010-09-23 07:52 | 2011-12-01 09:24 |
Reporter | eugenekryukov | Assigned To | Jonas Maebe | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | iPhone Simulator | OS | Mac OS X | ||
Product Version | 2.5.1 | ||||
Fixed in Version | 2.6.0 | ||||
Summary | 0017470: Linker error when linked for iPhoneOS Simulator | ||||
Description | Project can't linked for iPhoneOS Simulator (i386) for iPhone SDK 3.2+ (tested on 3.2, 4.0, 4.1). For iPhone SDK 2.x linker work correct. Undefined symbols: ".objc_class_name_NSObject", referenced from: .objc_class_name_ApplicationDelegate in vg_platform_ios.o .objc_class_name_TCocoaTimerObject in vg_platform_ios.o ".objc_class_name_NSString", referenced from: literal-pointer@__OBJC@__cls_refs@NSString in vg_platform_ios.o ".objc_class_name_UIWindow", referenced from: .objc_class_name_TvgNSWindow in vg_platform_ios.o ".objc_class_name_UIFont", referenced from: literal-pointer@__OBJC@__cls_refs@UIFont in vg_canvas_ios.o ".objc_class_name_UIImage", referenced from: literal-pointer@__OBJC@__cls_refs@UIImage in vg_canvas_ios.o ".objc_class_name_UIView", referenced from: .objc_class_name_TvgNSView in vg_platform_ios.o ".objc_class_name_NSTimer", referenced from: literal-pointer@__OBJC@__cls_refs@NSTimer in vg_platform_ios.o ".objc_class_name_UIViewController", referenced from: .objc_class_name_TvgNSViewController in vg_platform_ios.o ".objc_class_name_UIScreen", referenced from: literal-pointer@__OBJC@__cls_refs@UIScreen in vg_platform_ios.o ".objc_class_name_NSNotificationCenter", referenced from: literal-pointer@__OBJC@__cls_refs@NSNotificationCenter in vg_platform_ios.o ".objc_class_name_NSRunLoop", referenced from: literal-pointer@__OBJC@__cls_refs@NSRunLoop in vg_platform_ios.o ".objc_class_name_NSData", referenced from: literal-pointer@__OBJC@__cls_refs@NSData in vg_canvas_ios.o ".objc_class_name_NSDate", referenced from: literal-pointer@__OBJC@__cls_refs@NSDate in vg_platform_ios.o ".objc_class_name_UITextField", referenced from: literal-pointer@__OBJC@__cls_refs@UITextField in vg_platform_ios.o ".objc_class_name_UIDevice", referenced from: literal-pointer@__OBJC@__cls_refs@UIDevice in vg_platform_ios.o ".objc_class_name_NSAutoreleasePool", referenced from: literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in vg_platform_ios.o ld: symbol(s) not found For real device (ARM) project compiled and linked with out error. | ||||
Steps To Reproduce | Just use iPhone SDK 3.2 + | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 16065 | ||||
FPCOldBugId | 0 | ||||
FPCTarget | |||||
Attached Files |
|
|
There is now a separate iphonesim target that can be used to target iPhoneSimulators that use the Objective-C 2.0 ABI. In short: a) build the i386 compiler normally and install it b) build the iphonesim units: make FPC=installed_ppc386 OS_TARGET=iphonesim all c) install the iphonesim units: sudo make FPC=installed_ppc386 OS_TARGET=iphonesim install CROSSINSTALL=1 Next, you will also have to modify the Xcode build scripts (under the "fpc" target) so that a) the "build libfpc.a" and "Compile Pascal Sources" phases use the units from i386-iphonesim instead of i386-darwin when compiling for i386 b) the "Compile Pascal Sources" phase adds "-Tiphonesim" to the compiler options when compiling for i386 The iphonsim target defines both "darwin" and "iphonesim", so you can use {$ifdef darwin} for common code and {$ifdef iphonesim} for iphonesim-specific code. |
|
One more thing: step c) will also install a "ppcross386" compiler. You can ignore/delete it, as it is not different from the regular ppc386 installed during step b). You do *not* need it to compile iphonesim binaries, because any ppc386 compiler can always generate code for all i386 platforms. |
|
Not i have error when try to install iphonesim units: make FPC=installed_ppc386 OS_TARGET=iphonesim all Result: ... fpcmake -p -Ti386-iphonesim Makefile.fpc Processing Makefile.fpc Error: No targets set make[3]: *** [fpc_install] Error 1 make[2]: *** [rtl_distinstall] Error 2 make[1]: *** [installbase] Error 2 make: *** [install] Error 2 |
|
After the "make all" and before the "make install", copy utils/fpcm/fpcmake to /usr/local/bin |
|
Actually, the step a) in my instructions should already have updated the global fpcmake, so I'm not sure why it's not working for you. |
|
Does "which fpcmake" return /usr/local/bin ? |
|
I've now added "CROSSINSTALL=1" at the end of the iphonesim install line (point c), so that it will not overwrite the existing fpcmake and other utilities. However, that cannot have caused the problem because those binaries (obviously) also contain iphonesim support (and they're also plain i386 binaries, although they'll only run on 10.5 and later). |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-09-23 07:52 | eugenekryukov | New Issue | |
2010-09-30 14:13 | Jonas Maebe | Fixed in Revision | => 16065 |
2010-09-30 14:13 | Jonas Maebe | Status | new => resolved |
2010-09-30 14:13 | Jonas Maebe | Fixed in Version | => 2.5.1 |
2010-09-30 14:13 | Jonas Maebe | Resolution | open => fixed |
2010-09-30 14:13 | Jonas Maebe | Assigned To | => Jonas Maebe |
2010-09-30 14:13 | Jonas Maebe | Note Added: 0041382 | |
2010-09-30 14:25 | Jonas Maebe | Note Added: 0041383 | |
2010-10-01 06:33 | eugenekryukov | Status | resolved => feedback |
2010-10-01 06:33 | eugenekryukov | Resolution | fixed => reopened |
2010-10-01 06:33 | eugenekryukov | Note Added: 0041390 | |
2010-10-01 10:04 | Jonas Maebe | Status | feedback => resolved |
2010-10-01 10:04 | Jonas Maebe | Resolution | reopened => fixed |
2010-10-01 10:04 | Jonas Maebe | Note Added: 0041396 | |
2010-10-01 11:59 | Jonas Maebe | Note Added: 0041398 | |
2010-10-01 17:44 | Marco van de Voort | Note Added: 0041402 | |
2010-10-01 22:15 | Jonas Maebe | Note Edited: 0041382 | |
2010-10-01 22:19 | Jonas Maebe | Note Added: 0041411 | |
2010-10-02 00:50 | Jonas Maebe | Note Edited: 0041382 | |
2010-10-02 00:51 | Jonas Maebe | Note Edited: 0041382 | |
2011-12-01 09:24 | Marco van de Voort | FPCOldBugId | => 0 |
2011-12-01 09:24 | Marco van de Voort | Fixed in Version | 2.5.1 => 2.6.0 |