Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
770 Discussions

Can Intel C++ build programs without Visual Studio on Windows?

weichaohsu
Beginner
802 Views

Hi all,

 

I don't have Visual Studio installed on my computer due to the lack of a valid license. Therefore, I want to build programs using the command-line interface and wrote a 'HelloWorld' program to test.

Before building the program, I ran the setvars.bat located in the oneAPI folder. The output is as follows:"

C:\Users\ABC>setvars
:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
:: WARNING: Visual Studio was not found in a standard install location:
"C:\Program Files\Microsoft Visual Studio\<Year>\<Edition>" or
"C:\Program Files (x86)\Microsoft Visual Studio\<Year>\<Edition>"
Set the VS2019INSTALLDIR or VS2022INSTALLDIR environment variable to
point to your install location and try again. For example, if you
are using the VS 2022 Build Tools, do the following:
set "VS2022INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
Visual Studio command-line environment was not configured.
: advisor -- latest
: compiler -- latest
: dal -- latest
: debugger -- latest
: dev-utilities -- latest
: dpcpp-ct -- latest
:: WARNING: Visual Studio was not found in the standard installation location:
"C:\Program Files\Microsoft Visual Studio\<Year>\<Edition>" or
"C:\Program Files (x86)\Microsoft Visual Studio\<Year>\<Edition>"
Set the VS2017INSTALLDIR or VS2019INSTALLDIR or VS2022INSTALLDIR
environment variable to point to your install location and try again.
: dpl -- latest
: ipp -- latest
: ippcp -- latest
: mkl -- latest
: mpi -- latest
: ocloc -- latest
: tbb -- latest
: vtune -- latest
:: oneAPI environment initialized ::

 

While building the program, an error message appeared:

C:\Users\ABC\sources\test>icx test.cpp
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2024.2.1 Build 20240711
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

icx: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
C:\Users\ABC\sources\test\test.cpp(1,10): fatal error: 'iostream' file not found
1 | #include <iostream>
| ^~~~~~~~~~
1 error generated.

 

I have checked many of Intel's documents but didn't find any useful information. It seems to be an issue with the environment settings. Any idea?

 

Thank you

Dennis

0 Kudos
1 Reply
Reply