Basic ASIO setup producing error: Cannot open include file: 'iasiodrv.h'

Hi,

I’m fairly new to JUCE, and I would like to create a project with ASIO capabilities. However, when I create a new project using the projucer, and try to build it in visual studio (2019), I immediately get an error:

Cannot open include file: 'iasiodrv.h'

Can anybody help me with this? Other projects I’ve created don’t have this issue, only when I try to include ASIO. Here is what I did:

  1. Open projucer > File > New Project… > GUI Application
  2. Change target platform from VS 2017 to VS 2019, click create…
  3. Go to modules > juce_audio_devices > JUCE_ASIO, and change it from “Default (Disabled)” to “Enabled”.
  4. Save and Open the project in visual studio 2019.
  5. Run. Get Error.

Thanks,
Johnny.

You need the ASIO SDK.

Check out juce_audio_devices.cpp around line 100; the comments there explain why you have to get the necessary header files from Steinberg.

I generally copy the header files from the ASIO SDK into my Visual Studio project folder and then add

$(ProjectDir)

to my header search paths in the Projucer.

Matt

1 Like

Thanks for that pointer, that’s really useful to know.

Can you be a little bit more specific about how I should copy the files into my VS project folder? I don’t have much experience using SDKs apart from JUCE, but they make it really easy. Should I copy the contents of the “common” folder (from the ASIO download) into my “Source” folder in VS, alongside “Main.cpp” etc? Or can I put them in a more contained folder somehow?

Thanks,
Johnny

This is the mentioned comment in the code:

So IIUC in the windows exporter, add to Extra compiler flags: -IC:\\path\\ASIO\\common

haven’t tried that recently

Okay, so I managed to figure this issue out. Here’s what ended up working:

  1. With the project open in the projucer, go to Modules > juce_audio_devices, and set JUCE_ASIO to “Enabled”.
  2. Click the settings icon above the file explorer, and in “Header Search Paths”, add the path to the ASIO common folder from the ASIO SDK download - for me this is “C:\ASIOSDK2.3.2\common”

This should then work fine.

1 Like

Very frustrating indeed, but for me for a different reason:

I don’t understand why the ASIO SDK path is not part of all the other paths that we setup from the Projucer File/Global Paths menu.

There I can find the VST SDK path and many other paths we would like NOT to specify again on each new project, don’t tell me we have no right to add that asio path there but then we can add the vst sdk and all other plugins paths?

Would be fairly easy to add there and I would be volunteering for a contrib on Github if some people agree it would be a good idea…

Did I miss a simpler way (than changing the header search path on every new project) to do it?

PS: Just started to get involved into audio developments, not a beginner in programming though:
Here’s a recent WE app i developed to start to learn more about audio:


(ohmstudio is shutting down so this little app already helped a lot of people getting their mixdown trophies downloaded before the final shutdown)

PS2: Here’s a 10 minutes change I did (including searching projucer code):

Code is not consumed yet at project generation time but it is just a proof of concept!

Seems the use of a new Global path for audio apps, is a bit longer to implement with the current code there does not seem to be a pure audio ASIO app type :
see in juce_ProjectType.h:

struct Target
{
enum Type
{

GUIApp            = 0,
    ConsoleApp        = 1,
    StaticLibrary     = 2,
    DynamicLibrary    = 3,

    VSTPlugIn         = 10,
    VST3PlugIn        = 11,
    AAXPlugIn         = 12,
    RTASPlugIn        = 13,
    AudioUnitPlugIn   = 14,
    AudioUnitv3PlugIn = 15,
    StandalonePlugIn  = 16,
    UnityPlugIn       = 17,

    SharedCodeTarget  = 20, // internal
    AggregateTarget   = 21,

    unspecified       = 30
};

Unfortunately it seems that when creating an audio application, JUCE sets the project type to GUIApp …

Maybe that would be nice to have some design discussion and eventually get a new AsioApp = 4 enum value or similar?

This more work than I expected to do a simple injection though, so stopping here for now. Not sure why there is no way to distinguish an asio enabled app in projucer but not going to create it for just a small patch …

I can’t get it to work when using pure Cmake and MS Visual Studio. I can’t add it to project because CMake. I don’t understand if I need to add it to a CmakeList somewhere. Just copying it into the JUCE folder also doesn’t do jack.