[Portaudio] Is it possible to compile without dll or dll to be embed inside my app ?

Nick Appleton nick at appletonaudio.com
Mon Dec 5 03:26:56 EST 2016


Hi,

> On 5 Dec 2016, at 6:16 PM, Volker Bijewitz <volker at bijewitz.de> wrote:
> 
> Hi,
> 
> You have got two options:
> 
> 	• First you may create a project that builds a static library instead of a DLL. If you use MS Visual Studio, you create a new project from the type "WIN 32 projects - static library". Now you can add all the files to this project and link to this library.
> 	• Second you can include all required files into your main project - if you are developing under C/C++. The only thing that may happen are namespace conflicts, it may be neccessary to create a namespace for PortAudio. 
> For my opinion, you need to have good arguments to choose a way like this. A DLL is a very good concept, works perfectly and is good to maintain. And - as more as you change, as more you need to do if PortAudio gets updated. If you use a DLL, you just do a new build and deploy only this DLL. 
> 
> Volker Bijewitz
> 
> 
> Am 04.12.2016 um 18:36 schrieb Nocs ...:
>> I did the build in windows with mvs by following this tutorial http://portaudio.com/docs/v19-doxydocs/compile_windows.html
>> I am not so experienced to understand the mingw compilation way or any other than for mvs and the above link doesn`t says anything about static.
>> It creates 2 dll depending on the x86 or x64 build dlls and i want to be able to use only the .lib and the headers without the need of dll.
>> 
>> If there is another tutorial to link me to or someone can write me in step lines what to choose inside the build before compiling it will be great 
>> 
>> Thanks in advance
>> From: portaudio-bounces at lists.columbia.edu <portaudio-bounces at lists.columbia.edu> on behalf of Ross Bencina <rossb-lists at audiomulch.com>
>> Sent: Sunday, December 4, 2016 5:52:30 AM
>> To: portaudio list
>> Subject: Re: [Portaudio] Is it possible to compile without dll or dll to be embed inside my app ?
>>  
>> On 4/12/2016 2:25 PM, Nocs ... wrote:
>> > I would like to avoid using the dll as external siting near my
>> > applications executable, is this possible with port audio ?
>> 
>> Yes it's possible. You can build a static library, or just add the 
>> source files to your project and set the appropriate preprocessor 
>> symbols to select the APIs that you want.
>> 
>> You should be able to work this out from the tutorials, but if you need 
>> more info let us know where you get stuck.
>> 
>> Ross.

Just as another option, you could try the CMake build-system support which will allow you to build both static and dynamic PortAudio libraries easily using Visual Studio:

* Download CMake
* From another directory invoke CMake to generate project files (i.e. if PortAudio was in C:\PA and you wanted your project files in C:\PABuild, inside C:\PABuild invoke “cmake ..\PA -G {visual studio generator}” - you can find out the valid visual studio generators by invoking “cmake -G” from any location).
* You should now have a solution file which will build you static and dynamically linked PortAudio libraries.

Nick


More information about the Portaudio mailing list