Visual Studio 2015 build error with Clang 3.7

2019-06-21 10:21发布

问题:

So this is a followup question to Visual Studio 2015 Update 1, clang error

The error message I'm getting is

clang.exe : error : cannot specify -o when generating multiple output files

Basically, Hans Passant's workaround of disabling precompiled headers did not work for me. I'm still seeing the error. Anybody have any more ideas to work around this?

My VS-generated command line is: -fpic -std=c++1y -fstack-protector -x c++ "Debug\" -Wall -fno-strict-aliasing -ffunction-sections -I "c:\SDKs\VST3 SDK" -I "c:\SDKs\vstsdk2.4" -I "....\JuceLibraryCode" -I "......\JUCE\modules" -g2 -gdwarf-2 -O0 -x c++-header -D "_CRT_SECURE_NO_WARNINGS" -D "WIN32" -D "_WINDOWS" -D "DEBUG" -D "_DEBUG" -D "JUCER_VS2010_78A501D=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -D "_WINDLL" -frtti -fomit-frame-pointer -fdata-sections -fno-ms-compatibility -std=c11 -fexceptions -o "Debug\" -fms-extensions -fno-short-enums

I'm trying to build a C++ JUCE audio plugin in Windows with Clang because I ended up using a good amount of C++14 features when developing it initially on Mac and did not realize that other compilers were a bit more behind in C++ standard support. JUCE applications provide cross platform support by a VS/XCode project file or Makefile generated from the Introjucer/Projucer application. If I set up a new project with the VS2015 Cross-Platform C++ DLL with Clang 3.7 project template, everything compiles fine. But using the JUCE-generated VS project file and then switching the project preferences to use the Clang 3.7 project toolset is where I run into this error.