有没有 Visual C++ Linux 编译器支持大多数 VS Visual C++?
是否有适用于 Linux 的 Visual C++ 编译器支持大部分 VS Visual C++?
如果没有这样的移植\适应您的 Visual C++ 代码的最佳替代方案是什么?
Is there any Visual C++ compiler for linux supporting most of VS Visual C++?
If there is no such what is best alternative for porting\adapting your visual C++ code to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Visual C++ 是指集成开发环境和 C++ 编译器。出于所有实际意图和目的,它仅限于 Windows *实现*。
C++是一种语言。 Linux 有多个 C++ 编译器。如果您使用不可移植的扩展,例如 #pragma Once 而不是包含防护,请使用 DLL导入/导出内容或 Windows API 类型系统,那么您的代码在实现之间的可移植性将较差。其中大部分可以通过明智地使用预处理器和一些常识来控制。
最好的方法是首先编写可移植的代码和库。这并不像听起来那么难。
现在对于这个评论:我会为听起来冒犯而道歉,但如果你无法区分“C++”和“Visual C++”之间的区别,请学习英语语言(和C++)的这些元素。从长远来看,它会对你的编程有所帮助。
Linux 编译器 -> GNU C/C++ (GCC/G++)。另请参阅英特尔编译器。
适用于 Linux 的 IDE ->通常也可以在 Windows 上运行,请查看维基百科。
Visual C++ refers to an Integrated Development Environment and C++ Compiler. It is strictly Windows only * implementation* for all practical intents and purposes.
C++ is a language. Linux has several compilers for C++. If you use non-portable extensions, such as #pragma once instead of include guards, using the DLL import/export stuff, or the Windows APIs type system, then your code will be less portable between implementations. Much of this can be controlled with judicious use of the pre processor and some common sense.
The best way is to write portable code and libraries in the first place. It is not as hard as it sounds.
Now for this comment: I will apologise for sounding offensive, but if you can't tell the difference between "C++" and "Visual C++", please learn such elements of the English language (and C++). It will help you in the long run, programming wise.
Compilers for Linux -> GNU C/C++ (GCC/G++). See also Intels compiler.
IDEs for Linux -> generally run on Windows too, check wikipedia.
Mono 支持运行仅 CIL(意味着没有混合模式程序集)C++/CLI 程序集,但 Linux 上没有 C++/CLI 或托管 C++ 编译器。
您可以在 Mono 项目页面中阅读相关信息: http://www.mono-project.com/ CPlusPlus
Mono supports running CIL-only (meaning no mixed-mode assemblies) C++/CLI assemblies, but there's no C++/CLI or Managed C++ compiler on Linux.
You can read information about this in the Mono project page: http://www.mono-project.com/CPlusPlus
如果你的意思是一个支持大多数 VS 扩展/标准不合规的编译器,那么你就不走运了。如果你指的是编译/移植到 Linux 的环境,我会使用 g++ 并给自己找一个编辑器,例如 Emacs。我还听说过有关 Code::blocks 的好消息。
If you mean a compiler that supports most of the VS extensions/standards non-compliance you're out of luck. If you mean an environment to compile/port to Linux, I would just use g++ and get yourself an editor such as Emacs. I've also heard good things about Code::blocks.
我认为除了 Windows 之外,没有适用于托管 C++ 或 C++/CLI 的编译器。 Mono 项目(.NET for Linux)有一个 C# 编译器,尽管我不知道它是最新的。
不管怎样,我认为 .NET 的整体理念是它本身就是一个平台。不能在 Mono 上运行 Windows 可执行文件吗?
I don't think there's a compiler for Managed C++ or C++/CLI other than for Windows. The Mono project (.NET for Linux) has a C# compiler, although I don't know how up to date that is.
Anyway, I thought the whole idea about .NET was that it is a platform in itself. Can't you just run your Windows executables on Mono?
当我将 Windows 代码移植到 Linux 时,我通常在 Windows 中使用 Eclipse 以及 minGW。
When I am porting my Windows code to Linux, I usually use Eclipse in Windows along with minGW.
我使用 NetBeans 和 TDM-GCC。不幸的是我无法让 gdb 在 Windows 下工作。
I use NetBeans with TDM-GCC. Unfortunately I have not been able to get gdb to work under windows.