<div><div dir="auto">I’ve not used the MSVC build mode very much. I suspect that this is a name lookup failure and needs a namespace qualification. I’ll look into tweaking that when I’m near a computer. In the mean time, I recommend using the cross-compile or possibly trying with clang-cl.</div><br><div class="gmail_quote"><div>On Tue, Nov 14, 2017 at 1:05 PM Michael Gottesman <<a href="mailto:mgottesman@apple.com">mgottesman@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+CC Compnerd<br>
<br>
> On Nov 9, 2017, at 10:36 AM, Eric Wing via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:<br>
><br>
> I'm trying to build Swift for Windows with Visual Studio using the<br>
> directions found here:<br>
> <a href="https://github.com/apple/swift/blob/master/docs/Windows.md" rel="noreferrer" target="_blank">https://github.com/apple/swift/blob/master/docs/Windows.md</a><br>
><br>
> I'm following the MSVC section for directions. I am stuck in step 6.<br>
> LLVM/Clang/Compiler-RT<br>
><br>
> I seem to be hitting a C++ error in the code in IndexDataStore.h. Any<br>
> ideas on how to get around this?<br>
><br>
><br>
> C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1411~1.255\bin\Hostx64\x64\cl.exe<br>
> /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE<br>
> -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE<br>
> -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0<br>
> -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE<br>
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS<br>
> -Itools\clang\lib\Index -IC:\Source\SWIFT\llvm\tools\clang\lib\Index<br>
> -IC:\Source\SWIFT\llvm\tools\clang\include -Itools\clang\include<br>
> -Iinclude -IC:\Source\SWIFT\llvm\include /DWIN32 /D_WINDOWS<br>
> /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146<br>
> -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355<br>
> -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800<br>
> -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245<br>
> -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204<br>
> -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /MD /O1 /Ob1<br>
> -UNDEBUG /EHs-c- /GR- /showIncludes<br>
> /Fotools\clang\lib\Index\CMakeFiles\clangIndex.dir\IndexDataStore.cpp.obj<br>
> /Fdtools\clang\lib\Index\CMakeFiles\clangIndex.dir\clangIndex.pdb /FS<br>
> -c C:\Source\SWIFT\llvm\tools\clang\lib\Index\IndexDataStore.cpp<br>
> C:\Source\SWIFT\llvm\tools\clang\include\clang/Index/IndexDataStore.h(41):<br>
> error C3646: 'ModTime': unknown override specifier<br>
> C:\Source\SWIFT\llvm\tools\clang\include\clang/Index/IndexDataStore.h(41):<br>
> error C4430: missing type specifier - int assumed. Note: C++ does not<br>
> support default-int<br>
> C:\Source\SWIFT\llvm\tools\clang\include\clang/Index/IndexDataStore.h(74):<br>
> error C3646: 'ModTime': unknown override specifier<br>
> C:\Source\SWIFT\llvm\tools\clang\include\clang/Index/IndexDataStore.h(74):<br>
> error C4430: missing type specifier - int assumed. Note: C++ does not<br>
> support default-int<br>
> C:\Source\SWIFT\llvm\tools\clang\lib\Index\IndexDataStore.cpp(164):<br>
> error C2039: 'ModTime': is not a member of<br>
> 'clang::index::AbstractDirectoryWatcher::Event'<br>
> C:\Source\SWIFT\llvm\tools\clang\include\clang/Index/IndexDataStore.h(38):<br>
> note: see declaration of<br>
> 'clang::index::AbstractDirectoryWatcher::Event'<br>
> C:\Source\SWIFT\llvm\tools\clang\lib\Index\IndexDataStore.cpp(164):<br>
> error C2039: '__this': is not a member of<br>
> 'clang::index::AbstractDirectoryWatcher::Event'<br>
> C:\Source\SWIFT\llvm\tools\clang\include\clang/Index/IndexDataStore.h(38):<br>
> note: see declaration of<br>
> 'clang::index::AbstractDirectoryWatcher::Event'<br>
> [2723/3603] Building CXX object<br>
> tools\clang\lib\Index\CMakeFiles\clangIndex.dir\IndexingContext.cpp.obj<br>
> ninja: build stopped: subcommand failed.<br>
><br>
><br>
> Note: I'm using VS2017 instead of VS2015 because it's supposed to have<br>
> better C++ conformance.<br>
><br>
> I also want to note, building Debug hits a different fatal error where<br>
> MSVC aborts saying you must compile with /bigobj because the files are<br>
> too large. I changed my build and then hit the above compile error<br>
> with IndexDataStore.h. I then tried building a release version without<br>
> /bigobj, but I hit the same compile error with IndexDataStore.h.<br>
><br>
><br>
><br>
><br>
><br>
> Also, can somebody clarify what the differences are between the<br>
> different build approaches in the document (clang vs. MSVC vs.<br>
> clang-cl). Will these all produce binaries that are interoperable with<br>
> each other and allow me to link against regular MSVC built C<br>
> libraries? And do one of these clang options need MSVC's clang-C2?<br>
><br>
> And also, what is Compiler-RT and since it is optional, what do I lose<br>
> if I skip it?<br>
><br>
> And finally, why is the Win10 SDK needed? Doesn't that mean it won't<br>
> work on Win7 or Win8? What could Swift need that requires Win10 APIs?<br>
><br>
> Thanks,<br>
> Eric<br>
> _______________________________________________<br>
> swift-users mailing list<br>
> <a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>