Closed xaviergodart closed 7 years ago
I think the problem is that you are including omp.h
first and then the JuceLibraryHeader.h
. Try swapping the order of these includes.
Thanks for your help! I just tried swapping these inclusions and I still get the same error.
Something must be including winbase.h before you include the JUCE headers. JUCE doesn't include winbase.h when you compile FaustPluginProcessor.cpp
Why do you have this omp.h in the first place ? It seem you're are using faust2juce with the -omp flag ? They without this for now.
You're right, I was using the -omp flag to test out if it has a performance impact. Anyway, I just removed it and I still have this error.
Here is the updated cpp file: https://gist.github.com/xaviergodart/66e3b7ac9483735bb8ec1bba82ec923b
So it seem problems come because of "windows.h" inclusion : try to comment them and possibly the code that depends of them, just to check this hypothesis.
I commented the 2 "windows.h" inclusions (line 1146 and 7581) and slightly rewrote the "GetCurrentTimeInUsec" (l. 1147) to get it compile. I don't have the error anymore, and the compilation succeeded. So the problem comes from the "windows.h" inclusion.
Cubase doesn't seems to recognize the generated vst, but that's another thing.
Thanks for reporting. Another commit on master-dev to conditionally include "windows.h" , assuming that when compiled with JUCE, JuceLibraryHeader.h will already have done that. Can you possibly test again and report?
And of course I'm interested by your "Cubase in VST" tests : what happens with other JUCE example demos ? Do they work? Could it be a 32/64 bits issue?
Just tested again with the last master-dev. I have these errors:
1>..\..\FaustPluginProcessor.cpp(1151): error C2065: 'LARGE_INTEGER': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1151): error C2146: syntax error: missing ';' before identifier 'time'
1>..\..\FaustPluginProcessor.cpp(1151): error C2065: 'time': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1152): error C2065: 'LARGE_INTEGER': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1152): error C2146: syntax error: missing ';' before identifier 'frequency'
1>..\..\FaustPluginProcessor.cpp(1152): error C2065: 'frequency': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1153): error C2065: 'frequency': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1153): error C3861: 'QueryPerformanceFrequency': identifier not found
1>..\..\FaustPluginProcessor.cpp(1154): error C2065: 'time': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1154): error C3861: 'QueryPerformanceCounter': identifier not found
1>..\..\FaustPluginProcessor.cpp(1155): error C2065: 'time': undeclared identifier
1>..\..\FaustPluginProcessor.cpp(1155): error C2228: left of '.QuadPart' must have class/struct/union
1> ..\..\FaustPluginProcessor.cpp(1155): note: type is 'unknown-type'
1>..\..\FaustPluginProcessor.cpp(1155): error C2065: 'frequency': undeclared identifier
It seems that JUCE only includes "winbase.h" and not "windows.h". Tricky...
so Fabian (https://github.com/hogliux) : we have headers files that #include
Another try (following an advice given on #juce IRC...) : https://github.com/grame-cncm/faust/commit/052dc440417988e4900adc299e045ac02e4570d4
Can you test and report ?
Can you try #define JUCE_CORE_INCLUDE_NATIVE_HEADERS=1
before including JuceLibraryHeader.h
? This should include the windows headers for you.
Well :
1) we want to keep our multi-platform headers the way they are (that is they do #include
Tried the last master-dev. I have 5 "_Interlocked*" error. Here is the output log:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(82): error C2668: '_InterlockedCompareExchange': ambiguous call to overloaded function (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\intrin.h(179): note: could be 'long _InterlockedCompareExchange(volatile long *,long,long)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(9010): note: or 'unsigned __int64 `anonymous-namespace'::_InterlockedCompareExchange(volatile unsigned __int64 *,unsigned __int64,unsigned __int64)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8997): note: or 'unsigned long `anonymous-namespace'::_InterlockedCompareExchange(volatile unsigned long *,unsigned long,unsigned long)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8986): note: or 'unsigned int `anonymous-namespace'::_InterlockedCompareExchange(volatile unsigned int *,unsigned int,unsigned int)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(2738): note: or '`anonymous-namespace'::LONG `anonymous-namespace'::_InterlockedCompareExchange(volatile `anonymous-namespace'::LONG *,`anonymous-namespace'::LONG,`anonymous-namespace'::LONG)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(82): note: while trying to match the argument list '(volatile long *, std::_Atomic_integral_t, std::_Atomic_integral_t)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(100): error C2668: '_InterlockedIncrement': ambiguous call to overloaded function (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\intrin.h(259): note: could be 'long _InterlockedIncrement(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8844): note: or 'unsigned __int64 `anonymous-namespace'::_InterlockedIncrement(volatile unsigned __int64 *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8833): note: or 'unsigned long `anonymous-namespace'::_InterlockedIncrement(volatile unsigned long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8824): note: or 'unsigned int `anonymous-namespace'::_InterlockedIncrement(volatile unsigned int *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(2701): note: or '`anonymous-namespace'::LONG `anonymous-namespace'::_InterlockedIncrement(volatile `anonymous-namespace'::LONG *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(100): note: while trying to match the argument list '(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(105): error C2668: '_InterlockedIncrement': ambiguous call to overloaded function (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\intrin.h(259): note: could be 'long _InterlockedIncrement(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8844): note: or 'unsigned __int64 `anonymous-namespace'::_InterlockedIncrement(volatile unsigned __int64 *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8833): note: or 'unsigned long `anonymous-namespace'::_InterlockedIncrement(volatile unsigned long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8824): note: or 'unsigned int `anonymous-namespace'::_InterlockedIncrement(volatile unsigned int *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(2701): note: or '`anonymous-namespace'::LONG `anonymous-namespace'::_InterlockedIncrement(volatile `anonymous-namespace'::LONG *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(105): note: while trying to match the argument list '(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(110): error C2668: '_InterlockedDecrement': ambiguous call to overloaded function (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\intrin.h(209): note: could be 'long _InterlockedDecrement(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8875): note: or 'unsigned __int64 `anonymous-namespace'::_InterlockedDecrement(volatile unsigned __int64 *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8864): note: or 'unsigned long `anonymous-namespace'::_InterlockedDecrement(volatile unsigned long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8855): note: or 'unsigned int `anonymous-namespace'::_InterlockedDecrement(volatile unsigned int *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(2706): note: or '`anonymous-namespace'::LONG `anonymous-namespace'::_InterlockedDecrement(volatile `anonymous-namespace'::LONG *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(110): note: while trying to match the argument list '(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(119): error C2668: '_InterlockedDecrement': ambiguous call to overloaded function (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\intrin.h(209): note: could be 'long _InterlockedDecrement(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8875): note: or 'unsigned __int64 `anonymous-namespace'::_InterlockedDecrement(volatile unsigned __int64 *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8864): note: or 'unsigned long `anonymous-namespace'::_InterlockedDecrement(volatile unsigned long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8855): note: or 'unsigned int `anonymous-namespace'::_InterlockedDecrement(volatile unsigned int *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(2706): note: or '`anonymous-namespace'::LONG `anonymous-namespace'::_InterlockedDecrement(volatile `anonymous-namespace'::LONG *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(119): note: while trying to match the argument list '(volatile long *)' (compiling source file ..\..\FaustPluginProcessor.cpp)
Should be fixed in https://github.com/grame-cncm/faust/commit/10b37738706bccf603cdac2149a0403f05867774
Finally tested on VS 2013 in plugin and standalone modes.
It worked! Compilation succeeded for both vst2 and vst3. I was able to open and use the plugins with VSTHost (http://www.hermannseib.com/english/vsthost.htm), but they didn't showed in Cubase 5. Will investigate.
Anyway, thanks a lot for your work!
Hi there,
I have been playing with the faust2juce script of the Faust language which generate a ready to compile JUCE project. Here is the generated cpp file I'm using: https://gist.github.com/xaviergodart/66e3b7ac9483735bb8ec1bba82ec923b
I'm targeting VST 64bits. It works perfectly when using the Linux Makefile exporter. However, when using the Visual Studio 2015 exporter on Windows 7 64bits, I get the following error:
It seems that there is some sort of collision between Windows headers. I'm fairly new to cpp development, especially on Windows, and I can't figure out if the problem is coming from the faust generated file, JUCE, or my side.
I tried both 4.3.1 and the develop branch.
Here is the build log:
Thank you very much for your help.