vDSP를 호출하고 싶은 코드가 있습니다. 이것은 Xcode 프로젝트의 C ++ 파일입니다. 주요 프로젝트는 Objective C에 있습니다.
#include <Accelerate/Accelerate.h>
그것은 나에게 많은 오류를 준다.
#if defined(__cplusplus)
#pragma once
#include <Accelerate/Accelerate.h> // <-- error
#include "oscillator.h"
namespace synth {
class CQBLimitedOscillator : public COscillator
{
float dOuts[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
public:
CQBLimitedOscillator(void);
~CQBLimitedOscillator(void);
// --- init globals
inline virtual void initGlobalParameters(globalOscillatorParams* pGlobalOscParams)
{
// --- always call base class first to store pointer
COscillator::initGlobalParameters(pGlobalOscParams);
// --- add any QBL specifics here
}
// -- parallel proqcess 4 sawteeth
inline void doSawTeeth(float* dOutsIn, float dModulo, float dInc) {
float scalar2Val = 2.0f;
float scalar1Val = -1.0f;
// -- 2.0f*dValue - 1.0f
vDSP_vsmsa(dOutsIn, 1, &scalar2Val, &scalar1Val, dOutsIn, 1, 4);
}
oscillator.h에 포함 된 파일 중 하나는 다음과 같습니다.
#include "math.h"
그것을 다음으로 변경
#include <cmath>
트릭을했다. Accelerate는 이러한 방식 (cmath)에서도 수학 라이브러리를 사용합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다