无法在 Windows 上使用 Intel C++ 编译器执行程序

Program not executable using Intel C++ compiller on Windows

我想从 Linux 迁移到 Windows。我使用英特尔 OneAPI C++ 编译器。它适用于 Linux 使用 VS 代码或终端。我还没有安装 Visual Studio 应用程序。 在 Windows 我的代码使用 g++ 成功编译但使用 dpcpp 我得到错误:

Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm
dpcpp: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-cl.exe" -cc1 -triple spir64-unknown-unknown -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -fdeclare-spirv-builtins -mllvm -sycl-opt -fenable-sycl-dae -fms-extensions -fms-compatibility -fdelayed-template-parsing -fms-compatibility-version=19.14 -Wno-sycl-strict "-fsycl-int-header=C:\Users\wusik\AppData\Local\Temp\hello-header-858320.h" "-fsycl-int-footer=C:\Users\wusik\AppData\Local\Temp\hello-footer-ecbeef.h" -sycl-std=2020 -fsycl-unnamed-lambda -fsycl-unique-prefix=d65f6f35f968e95c -Wspir-compat -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model static -fveclib=SVML -mframe-pointer=all -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -fno-verbose-asm -mconstructor-aliases -aux-target-cpu x86-64 --dependent-lib=msvcrt --dependent-lib=libircmt --dependent-lib=svml_dispmd --dependent-lib=libdecimal --dependent-lib=libmmd --dependent-lib=oldnames -fdiagnostics-format msvc -debugger-tuning=gdb -v -ffunction-sections -resource-dir "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\..\include\sycl" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\..\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\..\compiler\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../compiler/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 10.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../compiler/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 10.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" -O2 -Wno-c++11-narrowing -std=c++17 -fdeprecated-macro "-fdebug-compilation-dir=D:\Documents\╨Я╤А╨╛╨╡╨║╤В╤Л\c++ training" -ferror-limit 19 -fmessage-length=120 -malign-double -fuse-line-directives -fms-extensions -fms-compatibility -std=c++17 -fno-threadsafe-statics -fdelayed-template-parsing -fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -disable-hir-generate-mkl-call -mllvm -intel-libirc-allowed -mllvm -loopopt=0 -floopopt-pipeline=none -o "C:\Users\wusik\AppData\Local\Temp\hello-58f4dd.bc" -x c++ ".\hello.cpp"
clang -cc1 version 14.0.0 based upon LLVM 14.0.0git default target x86_64-pc-windows-msvc
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\lib\clang.0.0\include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\lib\clang.0.0\include"
#include "..." search starts here:
#include <...> search starts here:
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\include\sycl
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\include
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\lib\clang.0.0\include
End of search list.
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\llvm-link" "C:\Users\wusik\AppData\Local\Temp\hello-58f4dd.bc" -o "C:\Users\wusik\AppData\Local\Temp\hello-2830d5.bc" --suppress-warnings
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-crt.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-crt-a5bc2d.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-complex.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-complex-dbf11f.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-complex-fp64.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-complex-fp64-280fc3.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-cmath.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-cmath-95e8ea.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-cmath-fp64.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-cmath-fp64-a7282d.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-fallback-cassert.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cassert-07b114.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-fallback-cstring.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cstring-4ffbd6.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-fallback-complex.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-complex-e71c2d.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-fallback-complex-fp64.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-complex-fp64-fb1ae0.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-fallback-cmath.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cmath-3b1e3d.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-bundler" -type=o -targets=sycl-spir64-unknown-unknown "-inputs=C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../lib\libsycl-fallback-cmath-fp64.obj" "-outputs=C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cmath-fp64-d68d1c.obj" -unbundle -allow-missing-bundles
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\llvm-link" -only-needed "C:\Users\wusik\AppData\Local\Temp\hello-2830d5.bc" "C:\Users\wusik\AppData\Local\Temp\libsycl-crt-a5bc2d.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-complex-dbf11f.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-complex-fp64-280fc3.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-cmath-95e8ea.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-cmath-fp64-a7282d.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cassert-07b114.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cstring-4ffbd6.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-complex-e71c2d.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-complex-fp64-fb1ae0.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cmath-3b1e3d.obj" "C:\Users\wusik\AppData\Local\Temp\libsycl-fallback-cmath-fp64-d68d1c.obj" -o "C:\Users\wusik\AppData\Local\Temp\hello-b3cdd5.bc" --suppress-warnings
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin\sycl-post-link" -split=auto -emit-param-info -symbols -emit-exported-symbols -split-esimd -lower-esimd -O2 -spec-const=rt -o "C:\Users\wusik\AppData\Local\Temp\hello-d7c5bc.table" "C:\Users\wusik\AppData\Local\Temp\hello-b3cdd5.bc"
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\file-table-tform" -extract=Code -drop_titles -o "C:\Users\wusik\AppData\Local\Temp\hello-9d7a68.txt" "C:\Users\wusik\AppData\Local\Temp\hello-d7c5bc.table"
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\llvm-foreach" "--in-file-list=C:\Users\wusik\AppData\Local\Temp\hello-9d7a68.txt" "--in-replace=C:\Users\wusik\AppData\Local\Temp\hello-9d7a68.txt" --out-ext=spv "--out-file-list=C:\Users\wusik\AppData\Local\Temp\hello-827aef.txt" "--out-replace=C:\Users\wusik\AppData\Local\Temp\hello-827aef.txt" -- "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\llvm-spirv" -o "C:\Users\wusik\AppData\Local\Temp\hello-827aef.txt" -spirv-max-version=1.3 -spirv-debug-info-version=ocl-100 -spirv-allow-extra-diexpressions -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=-all,+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls,+SPV_KHR_expect_assume,+SPV_INTEL_subgroups,+SPV_INTEL_media_block_io,+SPV_INTEL_device_side_avc_motion_estimation,+SPV_INTEL_fpga_loop_controls,+SPV_INTEL_fpga_memory_attributes,+SPV_INTEL_fpga_memory_accesses,+SPV_INTEL_unstructured_loop_controls,+SPV_INTEL_fpga_reg,+SPV_INTEL_blocking_pipes,+SPV_INTEL_function_pointers,+SPV_INTEL_kernel_attributes,+SPV_INTEL_io_pipes,+SPV_INTEL_inline_assembly,+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_float_controls2,+SPV_INTEL_vector_compute,+SPV_INTEL_fast_composite,+SPV_INTEL_fpga_buffer_location,+SPV_INTEL_joint_matrix,+SPV_INTEL_arbitrary_precision_fixed_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_variable_length_array,+SPV_INTEL_fp_fast_math_mode,+SPV_INTEL_fpga_cluster_attributes,+SPV_INTEL_loop_fuse,+SPV_INTEL_long_constant_composite,+SPV_INTEL_fpga_invocation_pipelining_attributes,+SPV_INTEL_fpga_dsp_control,+SPV_INTEL_arithmetic_fence,+SPV_INTEL_runtime_aligned,+SPV_INTEL_task_sequence,+SPV_INTEL_optnone,+SPV_INTEL_token_type,+SPV_INTEL_bfloat16_conversion,+SPV_INTEL_joint_matrix,+SPV_INTEL_hw_thread_queries,+SPV_INTEL_memory_access_aliasing "C:\Users\wusik\AppData\Local\Temp\hello-9d7a68.txt"
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\file-table-tform" -replace=Code,Code -o "C:\Users\wusik\AppData\Local\Temp\hello-65c029.table" "C:\Users\wusik\AppData\Local\Temp\hello-d7c5bc.table" "C:\Users\wusik\AppData\Local\Temp\hello-827aef.txt"
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-offload-wrapper" "-o=C:\Users\wusik\AppData\Local\Temp\wrapper-3cdeea.bc" -host=x86_64-pc-windows-msvc -target=spir64 -kind=sycl -batch "C:\Users\wusik\AppData\Local\Temp\hello-65c029.table"
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\llc" -filetype=obj -o "C:\Users\wusik\AppData\Local\Temp\hello-002a07.obj" "C:\Users\wusik\AppData\Local\Temp\wrapper-3cdeea.bc"
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\append-file" ".\hello.cpp" "--append=C:\Users\wusik\AppData\Local\Temp\hello-footer-ecbeef.h" --orig-filename=./hello.cpp "--output=C:\Users\wusik\AppData\Local\Temp\hello-8ede2b.cpp" --use-include
 "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\clang-cl.exe" -cc1 -triple x86_64-pc-windows-msvc19.14.0 -sycl-std=2020 -fsycl-unnamed-lambda -fsycl-unique-prefix=d65f6f35f968e95c -include "C:\Users\wusik\AppData\Local\Temp\hello-header-858320.h" -dependency-filter "C:\Users\wusik\AppData\Local\Temp\hello-header-858320.h" -fsycl-enable-int-header-diags -fsycl-is-host -emit-obj -mincremental-linker-compatible --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model pic -pic-level 2 -fveclib=SVML -mframe-pointer=none -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -fno-verbose-asm -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -mllvm -x86-enable-unaligned-vector-move=true -tune-cpu generic -D_MT -D_DLL --dependent-lib=msvcrt --dependent-lib=libircmt --dependent-lib=svml_dispmd --dependent-lib=libdecimal --dependent-lib=libmmd --dependent-lib=oldnames --dependent-lib=sycl -fdiagnostics-format msvc -v -ffunction-sections "-fcoverage-compilation-dir=D:\Documents\╨Я╤А╨╛╨╡╨║╤В╤Л\c++ training" -resource-dir "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\..\include\sycl" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\..\include" -iquote . -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm\..\compiler\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../compiler/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 10.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0\include" -internal-isystem "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\bin-llvm/../compiler/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 10.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" -header-base-path "C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows" -O2 -Wno-c++11-narrowing -std=c++17 -fdeprecated-macro "-fdebug-compilation-dir=D:\Documents\╨Я╤А╨╛╨╡╨║╤В╤Л\c++ training" -ferror-limit 19 -fmessage-length=120 -malign-double -fno-use-cxa-atexit -fuse-line-directives -fms-extensions -fms-compatibility -fms-compatibility-version=19.14 -std=c++17 -fdelayed-template-parsing -fcolor-diagnostics -vectorize-loops -vectorize-slp -fintel-compatibility -mllvm -disable-hir-generate-mkl-call -mllvm -intel-libirc-allowed -mllvm -loopopt=0 -floopopt-pipeline=none -mllvm -enable-lv -o "C:\Users\wusik\AppData\Local\Temp\hello-06b369.obj" -x c++ "C:\Users\wusik\AppData\Local\Temp\hello-8ede2b.cpp"
clang -cc1 version 14.0.0 based upon LLVM 14.0.0git default target x86_64-pc-windows-msvc
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\lib\clang.0.0\include"
ignoring duplicate directory "C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include"
#include "..." search starts here:
 .
#include <...> search starts here:
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\include\sycl
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\include
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\lib\clang.0.0\include
End of search list.
 "link.exe" -out:hello.exe /IGNORE:4078 "-libpath:lib\amd64" "-libpath:atlmfc\lib\amd64" "-libpath:C:\PROGRA~2\Intel\oneAPI\compiler\20221~1.0\windows\lib\clang\14.0.0\lib\windows" -nologo "C:\Users\wusik\AppData\Local\Temp\hello-06b369.obj" "C:\Users\wusik\AppData\Local\Temp\hello-002a07.obj"
dpcpp: error: unable to execute command: program not executable
dpcpp: error: linker command failed with exit code 1 (use -v to see invocation)

包括根本不起作用:

.....
#include "..." search starts here:
#include <...> search starts here:
 .
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\include\sycl
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\include
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\bin-llvm\..\compiler\include
 C:\PROGRA~2\Intel\oneAPI\compiler221~1.0\windows\lib\clang.0.0\include
 C:\Program Files (x86)\Intel\oneAPI\tbb\latest\env\..\include
 C:\Program Files (x86)\Intel\oneAPI\dev-utilities\latest\include
End of search list.
.\hello.cpp(3,10): fatal error: 'iostream' file not found
#include <iostream>
         ^~~~~~~~~~
1 error generated.

我也尝试根据 this 手册使用 VS Code 扩展而不是终端,但是在 Cmake 步骤中,我得到一个错误,说它在 Windows 中不受支持目标。

如何解决这个问题?我可以在不安装 Visual Studio 的情况下使用编译器吗?

如果您计划使用 dpc++,则需要安装 Visual Studio,因为它在 the compiler docs 中被指示为先决条件。