Hi I am trying to execute the Wikitude sample appl

2019-09-11 14:49发布

Build WikitudeAPI-SCM-Test of project WikitudeAPI-SCM-Test with configuration Debug

Ld build/Debug-iphonesimulator/WikitudeAPI-SCM-Test.app/WikitudeAPI-SCM-Test normal i386
cd /Users/srinivas/Downloads/WikitudeAPI_iPhone_1.0.7/SampleApp
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/srinivas/Downloads/WikitudeAPI_iPhone_1.0.7/SampleApp/build/Debug-iphonesimulator -L../WikitudeAPI -L../WikitudeAPI/usr -L../WikitudeAPI/usr/local -L../WikitudeAPI/usr/local/include -L../WikitudeAPI/usr/local/resources -L../WikitudeAPI/usr/local/resources/images -L../WikitudeAPI/usr/local/resources/libs -L../WikitudeAPI/usr/local/resources/nibs -L../WikitudeAPI/usr/local/resources/images/RECHECK -F/Users/srinivas/Downloads/WikitudeAPI_iPhone_1.0.7/SampleApp/build/Debug-iphonesimulator -filelist /Users/srinivas/Downloads/WikitudeAPI_iPhone_1.0.7/SampleApp/build/WikitudeAPI-SCM-Test.build/Debug-iphonesimulator/WikitudeAPI-SCM-Test.build/Objects-normal/i386/WikitudeAPI-SCM-Test.LinkFileList -mmacosx-version-min=10.6 -all_load -ObjC -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework CFNetwork -framework CoreData -framework CoreFoundation -framework CoreLocation -framework MapKit -framework MessageUI -framework QuartzCore -framework SystemConfiguration -lsqlite3.0 -lWikitudeAPI -lGoogleAnalytics -o /Users/srinivas/Downloads/WikitudeAPI_iPhone_1.0.7/SampleApp/build/Debug-iphonesimulator/WikitudeAPI-SCM-Test.app/WikitudeAPI-SCM-Test

ld: warning: in ../WikitudeAPI/libWikitudeAPI.a, missing required architecture i386 in file
Undefined symbols:
  "_OBJC_CLASS_$_WTPoi", referenced from:
      objc-class-ref-to-WTPoi in WikitudeAPI_SCM_TestAppDelegate.o
      objc-class-ref-to-WTPoi in CustomMenuButtonDelegateImpl1.o
  "_OBJC_CLASS_$_WikitudeARCustomMenuButton", referenced from:
      objc-class-ref-to-WikitudeARCustomMenuButton in WikitudeAPI_SCM_TestAppDelegate.o
  "_OBJC_CLASS_$_WikitudeARViewController", referenced from:
      objc-class-ref-to-WikitudeARViewController in WikitudeAPI_SCM_TestAppDelegate.o
      objc-class-ref-to-WikitudeARViewController in CustomMenuButtonDelegateImpl1.o
      objc-class-ref-to-WikitudeARViewController in CustomMenuButtonDelegateImpl3.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

2条回答
爷的心禁止访问
2楼-- · 2019-09-11 15:17

the Wikitude SDK only works on an actual iOS device, the simulator has no support for the camera and the necessary sensors (accelerometer, magnetometer).

Please try building and deploying on an actual iOS device, then everything should work as expected.

Cheers, Nicolas

查看更多
闹够了就滚
3楼-- · 2019-09-11 15:21

This is an old post but I didn't find a positive answer. Actually, I found a way to make it possible to compile in Simulator.

First of all, I edited the class (both h and m) with the Wikitude implementation and work with conditionals: it loads an interface and implementation when it's not a Simulator and it loads another interface and implementation when it's a Simulator:

Example.h

#import <UIKit/UIKit.h>
#import "Example.h"

#if !TARGET_IPHONE_SIMULATOR
#import <WikitudeSDK/WTArchitectView.h>

@interface Example : UIViewController <WTArchitectViewDelegate>
{
    WTArchitectView *_architectView;
}

@property (nonatomic, strong) WTArchitectView *architectView;

@end
#else
@interface Example : UIViewController {

}

@end
#endif

Example.m

#import "Example.h"

#if !TARGET_IPHONE_SIMULATOR
@interface Example () {
}

@end

@implementation Example // implementation for devices
.
.
.
@end
#else
@interface Example ()

@end

@implementation Example // implementation for simulator
.
.
.
@end
#endif

To toggle between compiling on the simulator and on devices, you just have to deactivate or activate the WikitudeSDK.framework for the current target:

1) Choose the WikitudeSDK.framework from the "Project Navigator" on the left panel.

2) Deactivate it for the current target using the "File Inspector" on the right panel.

It worked for me.

Best regards!

查看更多
登录 后发表回答