【发布时间】:2021-03-16 20:08:38
【问题描述】:
我正在尝试在 Clion 上运行 .asm 文件,并且我已经为其安装了 NASM,但我在指定 ASM 编译器时遇到了问题:
CMake Error at CMakeLists.txt:4 (enable_language):
The CMAKE_ASM_NASM_COMPILER:
C:/Users/User/AppData/Local/bin/NASM
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "ASM_NASM" or the CMake cache entry CMAKE_ASM_NASM_COMPILER to the
full path to the compiler, or to the compiler name if it is in the PATH.
mingw32-make.exe: *** [Makefile:175: cmake_check_build_system] Error 1
-- The ASM_NASM compiler identification is unknown
-- Found assembler: C:/Users/User/AppData/Local/bin/NASM
-- Configuring incomplete, errors occurred!
问题在于这个“完整路径”,但我不太明白,它是什么意思。 这是我的 CMakeLists.txt :
cmake_minimum_required(VERSION 3.17)
project(untitled C)
set(CMAKE_ASM_NASM_COMPILER C:/Users/User/AppData/Local/bin/NASM)
enable_language(ASM_NASM)
set(ASM_SOURCES
test.asm)
set(SOURCES
${ASM_SOURCES})
set_source_files_properties(test.asm PROPERTIES LANGUAGE ASM_NASM)
add_executable(program ${SOURCES})
我也在这里阅读了类似的问题(但关于 C/C++ 编译器),它们对我的情况并没有真正的帮助。
感谢您的回答!
【问题讨论】:
标签: windows assembly cmake nasm clion