I'm working on a project that involves integrating the Zoom SDK into my application. As part of this integration, I'm trying to implement a custom class named
RawAudioDelegate
to handle raw audio data. However, I'm encountering linker errors related to unresolved external symbols when trying to build my project.
Description:
I have a class named
RawAudioDelegate
which inherits from
IZoomSDKAudioRawDataDelegate
from the Zoom SDK. In my header file
RawAudioDelegate.h, I have declared two methods:
onOneWayAudioRawDataReceived
and
onMixedAudioRawDataReceived
. The implementations for these methods are provided in a separate
.cpp file named
RawAudioDelegate.cpp.
The issue arises during the linking phase, where I get the following linker errors:
Error LNK2001: unresolved external symbol "public: virtual void __thiscall RawAudioDelegate::onOneWayAudioRawDataReceived(class AudioRawData *,unsigned int)" ...
Error LNK2001: unresolved external symbol "public: virtual void __thiscall RawAudioDelegate::onMixedAudioRawDataReceived(class AudioRawData *)" ...
My Code Snippets:
cpp file
#include "stdafx.h"
#include "rawdata/rawdata_audio_helper_interface.h"
#include "RawAudioDelegate.h"
#include "zoom_sdk_def.h"
#include <fstream>
using namespace std;
using namespace ZOOM_SDK_NAMESPACE;
void RawAudioDelegate::onOneWayAudioRawDataReceived(AudioRawData* data_, uint32_t node_id)
{
std::cout << "+++ data received from node:" << node_id << std::endl;
}
void RawAudioDelegate::onMixedAudioRawDataReceived(AudioRawData* data_)
{
std::cout << "Received onMixedAudioRawDataReceived" << std::endl;
static ofstream pcmFile;
pcmFile.open("audio.pcm", ios::out | ios::binary | ios::app);
if (!pcmFile.is_open()) {
cout << "Failed to open wave file" << endl;
return;
}
try {
pcmFile.write((char*)data_->GetBuffer(), data_->GetBufferLen());
std::cout << "buffer : " << data_->GetBuffer() << std::endl;
pcmFile.close();
pcmFile.flush();
}
catch (exception e)
{
cout << "Failed to write wave file" << endl;
}
}
Header file
#pragma once
#include "stdafx.h"
#include "rawdata/rawdata_audio_helper_interface.h"
#include "zoom_sdk.h"
#include "zoom_sdk_raw_data_def.h"
#include <iostream>
using namespace std;
using namespace ZOOM_SDK_NAMESPACE;
class RawAudioDelegate :
public ZOOM_SDK_NAMESPACE::IZoomSDKAudioRawDataDelegate
{
public:
virtual void onMixedAudioRawDataReceived(AudioRawData* data_);
virtual void onOneWayAudioRawDataReceived(AudioRawData* data_, uint32_t node_id);
};
What I have tried:
I have checked that the
RawAudioDelegate.cpp file is included in the project.
I verified that the header guard in
RawAudioDelegate.h is correctly defined.
I confirmed that I'm using the correct configuration (x86/x64) to match the SDK and project architecture.
I have checked that I'm correctly linking against the necessary Zoom SDK libraries.