Because Linphone cannot be directly compiled with vs, but it is very convenient to compile with mingw, we can call the library compiled by mingw through. This solution is to create the Lib file required by vs from the DLL.
1. mingw compile linphone-3.5.2
Reference http://blog.csdn.net/gavinr/article/details/7337606
2. Create the Lib file required by
To create a Def file, use a third-party tool pexports. You can run the command mingw-Get install pexports in mingw to install the file.
$ Pexports liblinphone-4.dll> Linphone. Def
$ Pexports libmediastreamer-1.dll> mediastreamer. Def
Create a lib file and use the Lib program that comes with. Open the vs command line and execute the following operations:
E: \ Temp> lib/machine: x86/DEF: Linphone. Def
Microsoft (r) Library Manager version 9.00.21022.08
Copyright (c) Microsoft Corporation. All rights reserved.
Creating library Linphone. lib and object Linphone. Exp
Generate mediastream. Lib in the same way
3. vs test project
Vs2008 build a console project linphone-3.5.2, the test code directly uses the previous written test code (with vs compiled there will be a small error, the variable definition statement put at the beginning of the function): http://blog.csdn.net/gavinr/article/details/7344916
Add the dependent library mediastream. Lib Linphone. Lib
Add the header file directory, D: \ mingw \ msys \ 1.0 \ Local \ include
This compilation should be able to successfully generate the executable program linphone-3.5.2.exe.
4. Test
Because it relies on many other libraries, it is too lazy to find them in the mingw, so it is directly carried out in the mingw command line during testing.
Call remote SIP client
$ Linphone-3.5.2 SIP: 192.168.9.81
Ortp-error-fail to create class enumerator.
Ortp-warning-./share/sounds/Linphone/rings/oldphone.wav does not exist
Call state: Starting outgoing call
Unhandled notification 2
Call to sip: 192.168.9.81 is in progress... ortp-warning-cannot set noise gate mod
E to [0] because no volume send
Call state: outgoing call in progress
Unhandled notification 3
Ortp-warning-failed to open./share/sounds/Linphone/ringback.wav
Call state: Remote ringing