Andersama / obs-asio

ASIO plugin for OBS-Studio
GNU General Public License v3.0
664 stars 43 forks source link

Compilation question #115

Closed walker-WSH closed 2 years ago

walker-WSH commented 2 years ago

Hi, I am trying to compile this plugin. As the wiki, I should compile juce.lib firstly.

I clone JUCE and open the solution. However there is no project of juce.lib. In the document of Projucer, I don’t find any tips.

Can you give me any idea ? Many thanks~

1653982033

1653981390

Andersama commented 2 years ago

I don't remember the project structure for Juce. What you want is to compile Juce as a library such that this file:

https://github.com/juce-framework/JUCE/blob/0abbba3b18c3263137eeaeaa11c917a3425ce585/modules/juce_audio_devices/native/juce_win32_ASIO.cpp

Is added as part of the compilation.

To do that you have to define the macro JUCE_ASIO as 1 before this header gets included that way the binary gets compiled with ASIO device support. Otherwise you won't be able to scan for asio devices.

https://github.com/juce-framework/JUCE/blob/0abbba3b18c3263137eeaeaa11c917a3425ce585/modules/juce_audio_devices/juce_audio_devices.h

Hope that helps, best of luck.

walker-WSH commented 2 years ago

I don't remember the project structure for Juce. What you want is to compile Juce as a library such that this file:

https://github.com/juce-framework/JUCE/blob/0abbba3b18c3263137eeaeaa11c917a3425ce585/modules/juce_audio_devices/native/juce_win32_ASIO.cpp

Is added as part of the compilation.

To do that you have to define the macro JUCE_ASIO as 1 before this header gets included that way the binary gets compiled with ASIO device support. Otherwise you won't be able to scan for asio devices.

https://github.com/juce-framework/JUCE/blob/0abbba3b18c3263137eeaeaa11c917a3425ce585/modules/juce_audio_devices/juce_audio_devices.h

Hope that helps, best of luck.

many thinks ~ I will try it again. I find the header included in your plugin is "JuceHeader.h" and it is located in: JUCE\extras\WindowsDLL\JuceLibraryCode\JuceHeader.h I thinks the WindowsDLL is just the project you said.

walker-WSH commented 2 years ago

Here is the steps that I success to compile JUCE with ASIO supported. Hope it can help others.

  1. download JUCE code: https://github.com/juce-framework/JUCE
  2. download ASIO SDK:https://www.steinberg.net/developers/
  3. open sln: JUCE\extras\WindowsDLL\Builds\VisualStudio2022\WindowsDLL.sln
  4. add include path for ASIO SDK: asiosdk_2.3.3_2019-06-14\common\
  5. search JUCE_ASIO injuce_audio_devices.hand modiy it with 1;
  6. maybe you will meet compile error with C2385, add macro for class ParameterComponent

    class ParameterComponent : public Component,
                           public ParameterListener
    {
    public:
    using ParameterListener::ParameterListener;
    
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ParameterComponent) // add it to fix compile error
    };

While using juce library, you may meet the compile error below for "#include <JuceHeader.h>". You can fix it by adding #define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED before including JuceHeader.h fatal error C1189: #error: "No global header file was included!"

Libraries below should be linked while using juce library:

kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
juce_dll.lib
Andersama commented 2 years ago

Glad you managed to work it out, and thanks for including instructions.