![](/img/trans.png)
[英]Bridging C++ and Swift in XCode, what are the right Build Settings?
[英]What settings are needed in Xcode to get this code to build
讓我們看看這個代碼,它位於 header 文件中。 項目本身是 Objective-C++(.h &.mm 文件)。
這看起來像是 C++ 和 Objective-C 的混合體。 根據我的閱讀,為了將 Objective-C++ 與 Objective-C 混合,您必須將所有 C++ 內容保留在 header 文件之外,但這不是案例。
該項目構建良好,但是我無法在新項目中復制它(通過復制相同的代碼)。
Xcode 需要哪些設置才能構建? 已經比較了項目構建設置,它們是相同的。
這些錯誤與Options
結構中的內聯初始化程序有關。
/*
This file is part of the Structure SDK.
Copyright © 2019 Occipital, Inc. All rights reserved.
http://structure.io
*/
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <Structure/Structure.h>
#import <Structure/STCaptureSession.h>
#import "CalibrationOverlay.h"
#import "MeshViewController.h"
#import "SettingsPopupView.h"
// See default initialization in: -(void)initializeDynamicOptions
struct DynamicOptions
{
bool depthAndColorTrackerIsOn;
bool improvedTrackingIsOn;
bool highResColoring;
bool improvedMapperIsOn;
bool highResMapping;
STCaptureSessionPreset depthStreamPreset;
};
struct Options
{
// The initial scanning volume size will be 0.5 x 0.5 x 0.5 meters
// (X is left-right, Y is up-down, Z is forward-back)
const GLKVector3 initVolumeSizeInMeters = GLKVector3Make (0.5f, 0.5f, 0.5f);
// The maximum number of keyframes saved in keyFrameManager
int maxNumKeyFrames = 48;
// Colorizer quality
STColorizerQuality colorizerQuality = STColorizerHighQuality;
// Take a new keyframe in the rotation difference is higher than 20 degrees.
float maxKeyFrameRotation = 20.0f * (M_PI / 180.f); // 20 degrees
// Take a new keyframe if the translation difference is higher than 30 cm.
float maxKeyFrameTranslation = 0.3; // 30cm
// Threshold to consider that the rotation motion was small enough for a frame to be accepted
// as a keyframe. This avoids capturing keyframes with strong motion blur / rolling shutter.
float maxKeyframeRotationSpeedInDegreesPerSecond = 1.f;
// Whether we should use depth aligned to the color viewpoint when Structure Sensor was calibrated.
// This setting may get overwritten to false if no color camera can be used.
bool useHardwareRegisteredDepth = false;
// Whether to enable an expensive per-frame depth accuracy refinement.
// Note: this option requires useHardwareRegisteredDepth to be set to false.
const bool applyExpensiveCorrectionToDepth = true;
// Whether the colorizer should try harder to preserve appearance of the first keyframe.
// Recommended for face scans.
bool prioritizeFirstFrameColor = true;
// Target number of faces of the final textured mesh.
int colorizerTargetNumFaces = 50000;
// Focus position for the color camera (between 0 and 1). Must remain fixed one depth streaming
// has started when using hardware registered depth.
const float lensPosition = 0.75f;
};
...
@interface ViewController : UIViewController <STBackgroundTaskDelegate, MeshViewDelegate, AVCaptureVideoDataOutputSampleBufferDelegate, UIPopoverControllerDelegate, UIGestureRecognizerDelegate, SettingsPopupViewDelegate>
{
...
}
@end
有關錯誤的一些詳細信息:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.