Is there any way to compile an intel-sgx app (and specifically- the untrusted part) in visual studio's command prompt so that
the that header file and libraries will be recognized at compilation?
The easiest way is to use the "MSBUILD" utility that comes with Visual Studio to give you the exact commands to build either the Enclave or the App on the command line.
Here are the few settings that you may need:
To include the current directory in the search: set INCLUDE=.;%INCLUDE%
To include "rc.exe" in the build of the app: set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
Here is how you can compile and build: msbuild /p:useenv=true Enclave.vcxproj
and msbuild /p:useenv=true App.vcxproj
Here is an example of build command for the untrusted app: