Visual Studio 2019 C++在 Linux 上 - 错误:无法对多个文件指定 -o 和 -c、-S 或 -E
我正在尝试在 Linux(Debian VM)上的 VS2019 中编译 C++ 控制台项目。我已经正确设置了连接管理器,VS 确实将源文件复制到 Linux VM 上,并尝试使用那里的 g++ 编译器进行编译。它会抛出十几个或更多相同的错误:
不能将 -o 与 -c、-S 或 -E 一起指定用于多个文件 编译终止。
我是 g++ 编译器的新手,因为我一直只在本地 Windows 计算机上使用 Visual Studio。我不知道这条消息的含义,这似乎是开始的地方。配置属性中 C/C++ 下的命令行如下所示:
"g++" -W"switch" -W"no-deprecated-declarations" -W"empty-body" -W"conversion" -W"return-type"
-W"parentheses" -W"no-pointer-sign" -W"no-format" -W"uninitialized" -W"unreachable-code"
-W"unused-function" -W"unused-value" -W"unused-variable" -std=c++11 -Wall -fno-strict-aliasing
-g2 -gdwarf-2 "g++" -O0 -fthreadsafe-statics -W"switch" -W"no-deprecated-declarations" -W"empty-
body" -W"conversion" -W"return-type" -W"parentheses" -W"no-format" -W"uninitialized"
-W"unreachable-code" -W"unused-function" -W"unused-value" -W"unused-variable" -frtti -fno-omit-
frame-pointer -std=c11 -fexceptions -I "/usr/include/apr-1.0/include" "1" -o "C:\Users\Jimbo1987
\Documents\Visual Studio 2019\cms_example\obj\x64\Debug\%(filename).o"
确实有多个 .cpp 和 .h 文件,但没有 -c、-S 或 -E 标志。我显然错过了一些非常简单和基本的东西,因为我不知道如何手动提供编译器而不使用 makefile 将其全部自动化。
有人可以指出我理解这一点的正确方向吗?
I'm trying to compile a C++ Console project in VS2019 on Linux (a Debian VM). I've set up the Connection Manager properly, and VS does copy the source files onto the Linux VM and attempts to compile using the g++ compiler there. It throws a dozen or more of the same error:
cannot specify -o with -c, -S or -E with multiple files
compilation terminated.
I'm a newb with the g++ compiler, as I've always just used Visual Studio on a local Windows machine. I have no idea what the message means, which seems the place to start. Command Line under C/C++ in Configuration Properties looks like this:
"g++" -W"switch" -W"no-deprecated-declarations" -W"empty-body" -W"conversion" -W"return-type"
-W"parentheses" -W"no-pointer-sign" -W"no-format" -W"uninitialized" -W"unreachable-code"
-W"unused-function" -W"unused-value" -W"unused-variable" -std=c++11 -Wall -fno-strict-aliasing
-g2 -gdwarf-2 "g++" -O0 -fthreadsafe-statics -W"switch" -W"no-deprecated-declarations" -W"empty-
body" -W"conversion" -W"return-type" -W"parentheses" -W"no-format" -W"uninitialized"
-W"unreachable-code" -W"unused-function" -W"unused-value" -W"unused-variable" -frtti -fno-omit-
frame-pointer -std=c11 -fexceptions -I "/usr/include/apr-1.0/include" "1" -o "C:\Users\Jimbo1987
\Documents\Visual Studio 2019\cms_example\obj\x64\Debug\%(filename).o"
There are indeed multiple .cpp and .h files, but there are no -c, -S, or -E flags. I'm obviously missing something extremely simple and fundamental for not knowing how to manually feed a compiler without having it all automated for me with a makefile.
Can somebody point me in the right direction to understand this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论