I am very new to Objective C world please bear with me. I am working on some iOS metal project using xCode. I am getting some strange linking error during compilation.
Defined as
class MetalDevice {
public:
MetalDevice();
std::shared_ptr createQueueForOperation(GPU_OPERATIONS gpuOperations);
private:
id _device;
};
And it's corresponding objeciveC++ (.mm) file is
MetalDevice::MetalDevice() {
_device = MTLCreateSystemDefaultDevice();
}
std::shared_ptr<GPUQueue> MetalDevice::createQueueForOperation(GPU_OPERATIONS gpuOperations) {
return std::dynamic_pointer_cast<GPUQueue>(std::make_shared<MetalQueue>(_device));
}
My MetalQueue file is expecting MetalDevice as a parameter
class MetalQueue: public GPUQueue {
public:
~MetalQueue() {}
MetalQueue(id device){}
};
I am getting following linking error
U
undefined symbols for architecture arm64: "vtable for
metalCPP::MetalQueue", referenced from:
metalCPP::MetalQueue::MetalQueue(id) in MetalDevice.o NOTE: a missing vtable usually means the first non-inline virtual
member function has no definition. ld: symbol(s) not found for
architecture arm64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
Can someone please help me how to resolve this error.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…