有人可以帮助我了解此错误消息吗?

时间:2020-11-07 03:31:18

标签: c++ makefile

我目前正在从头开始创建虚拟机。我在网上找到了一个视频,我一直在跟踪它,但是当需要编译我的C ++程序时,那个家伙说运行'make'命令来编译它。我在Visual Studio Developer命令提示符下使用了NMake,它给了我这个错误消息:

cl -std=c++11 -c stack-vm.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
stack-vm.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ostream(285): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ostream(270): note: while compiling class template member function 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(int)'
stack-vm.cpp(53): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(int)' being compiled
stack-vm.cpp(49): note: see reference to class template instantiation 'std::basic_ostream<char,std::char_traits<char>>' being compiled
        cl -std=c++11 -c main.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
main.cpp
        cl -std=c++11 stack-vm.o main.o -o stack-vm
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
cl : Command line warning D9024 : unrecognized source file type 'stack-vm.o', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'main.o', object file assumed
Microsoft (R) Incremental Linker Version 14.27.29112.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:stack-vm.exe
/out:stack-vm.exe
stack-vm.o
main.o
LINK : fatal error LNK1181: cannot open input file 'stack-vm.o'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86\cl.EXE"' : return code '0x2'
Stop.

注意:我已经有一个makefile设置。

有人可以帮助我了解此错误吗?如果您需要源代码,请与我联系。 非常感谢!

0 个答案:

没有答案