Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,everyone:
I have build webrtc on vs2008,and got the voice_engine.lib .But how can i use it in my application?I have tried to simply #pragma comment(lib,"voice_engine.lib"),but errors occur when linking (unresolved external symbols),such as:
voice_engine.lib(dtmf_inband_queue.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl webrtc::Trace::Add(enum webrtc::TraceLevel,enum webrtc::TraceModule,int,char const *,...)" (?Add@Trace@webrtc@@SAXW4TraceLevel@2@W4TraceModule@2@HPBDZZ)

I just get confused ,i have #pragma the lib ,have i?But error just occurs.

appreciation to any reply!
Posted

1 solution

Seems that i have got the resolution.
voice_engine.lib was not built alone,it depended on many other libs.You should also #pragma other libs,if you want to use voice_engine.lib.Here is my first simple demo ,just to play a wav file.
C++
//you also to include this debug.pb.h
#include "m:\WebRTC\trunk\build\Debug\obj\global_intermediate\protoc_out\webrtc\audio_processing\debug.pb.h"
#include "webrtc/voice_engine/include/voe_base.h"
#include "webrtc/voice_engine/include/voe_file.h"

#include <conio.h>

#pragma comment(lib,"voice_engine.lib")
#pragma comment(lib,"system_wrappers.lib")
#pragma comment(lib,"audio_processing.lib")
#pragma comment(lib,"audio_device.lib")
#pragma comment(lib,"common_audio.lib")
#pragma comment(lib,"webrtc_utility.lib")//ProcessThread
#pragma comment(lib,"audio_conference_mixer.lib")
#pragma comment(lib,"audio_coding_module.lib")
#pragma comment(lib,"rtp_rtcp.lib")
#pragma comment(lib,"media_file.lib")
#pragma comment(lib,"audio_processing_sse2.lib")
#pragma comment(lib,"audioproc_debug_proto.lib")
#pragma comment(lib,"audioproc_unittest_proto.lib")
#pragma comment(lib,"webrtc_i420.lib")
#pragma comment(lib,"webrtc_opus.lib")
#pragma comment(lib,"opus.lib")
#pragma comment(lib,"common_audio.lib")
#pragma comment(lib,"common_audio_sse2.lib")
#pragma comment(lib,"webrtc_video_coding.lib")
#pragma comment(lib,"common_video.lib")
#pragma comment(lib,"NetEq.lib")
#pragma comment(lib,"CNG.lib")
#pragma comment(lib,"PCM16B.lib")
#pragma comment(lib,"G722.lib")
#pragma comment(lib,"G711.lib")
#pragma comment(lib,"iLBC.lib")
#pragma comment(lib,"audio_coding_module.lib")
#pragma comment(lib,"iSAC.lib")
#pragma comment(lib,"paced_sender.lib")
#pragma comment(lib,"webrtc_vp8.lib")
#pragma comment(lib,"test_framework.lib")
#pragma comment(lib,"video_coding_utility.lib")
#pragma comment(lib,"libyuv.lib")
#pragma comment(lib,"libvpx.lib")
#pragma comment(lib,"libjpeg.lib")
#pragma comment(lib,"protobuf_lite.lib")
#pragma comment(lib,"libvpx_asm_offsets_vp8.lib")
#pragma comment(lib,"libvpx_intrinsics_mmx.lib")
#pragma comment(lib,"libvpx_intrinsics_sse2.lib")
#pragma comment(lib,"libvpx_intrinsics_ssse3.lib")

using namespace webrtc;

VoiceEngine* pVoeEngine;
VoEFile		*pVoeFile;
VoEBase* pVoeBase ;

int main(int argc,char** argv)
{
	pVoeEngine = VoiceEngine::Create();               
	pVoeBase = VoEBase::GetInterface(pVoeEngine);  
	pVoeFile =VoEFile::GetInterface(pVoeEngine);
	pVoeBase->Init();       
	int channel=pVoeBase->CreateChannel();  
	pVoeBase->StartPlayout(channel);
	pVoeFile->StartPlayingFileLocally(channel,"G:\\1.wav");
	getchar();
}</conio.h>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900