这个技巧看起来很简单,但我不知道如何设置,
我做了什么:
转到存档>首选项>用户配置。
在右边的面板中我写了这个......
{
"terminal.integrated.shell.windows":
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat"
}
Run Code Online (Sandbox Code Playgroud)
工作直到突然消失。
考虑launch.json脚本只是为了不写在控制台上并使用播放按钮,我知道cl是为了调用编译器但不知道如何处理参数。有人建议使用Cmake。
我想要的只是使用 VC/C++ 编译器(不限于 2017 版本,可以是任何版本)运行临时代码,因此任何解决方案都将受到高度赞赏。
就像在 CLion 中我想使用SFMLVisual Studio 2017 中,但我仍在学习 cmake,我根本不知道 cmake 工作方式的命令或逻辑。我刚刚看到了一些帖子并得到了这个小脚本。
注意:我在提供的链接中下载了最新版本的 sfml,我只是将提取的目录放在我的文件夹中的 CMakeLists.txt 旁边
#sets up the minimum version of cmake
cmake_minimum_required(VERSION 3.9)
#how the project will be called
project (space_impact)
#set c++11 standard
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" -std=c++11)
#set source files
set (SOURCE_FILES main.cpp)
#we add the executable of the program
add_executable (space_impact ${SOURCE_FILES})
#taked from a mac-clion tutorial, doesn't work
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/SFML/cmake-modules/")
find_package (SFML REQUIRED system window graphics network audio)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(space_impact ${SFML_LIBRARIES})
endif()
Run Code Online (Sandbox Code Playgroud)
那件事给了我错误: …