如何为Linux构建Visual C ++项目? [英] How to build a Visual C++ Project for Linux?

查看:71
本文介绍了如何为Linux构建Visual C ++项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中编写一个C ++应用程序的最好和最简单的方法是什么?代码本身就准备好了 - 我只使用跨平台的libs。

What's the best and easiest way to build (for Linux) a C++ application which was written in Visual Studio? The code itself is ready - I used only cross-platform libs.

可以在Visual Studio中准备Windows下的所有内容,然后使用Linux工具在Linux下构建它?有没有什么文档描述这个?

Is it possible to prepare everything under Windows in Visual Studio and then build it with a CLI tool under Linux? Are there any docs describing this?

编辑:一些详细信息:


  • 使用的libs:stl,wxwidgets,boost,asio,cryptlib。

  • Libs used: stl, wxwidgets, boost, asio, cryptlib.

非常少的Linux技术。

Very little Linux know-how.

EDIT#2:我选择了以下解决方案:使用kdevelop制作新项目并编译所有内容。

EDIT#2: I chose the following solution: Make new project with kdevelop and compile everything there.

推荐答案

我们正在为Linux项目使用CMake。 CMake可以生成KDevelop和Visual Studio项目文件,所以您可以创建您的CMake文件作为平台特定的IDE文件的来源。 KDevelop生成器很好,所以你可以在KDevelop中编辑和编译(这将调用Make)。

We're using CMake for Linux projects. CMake can generate KDevelop and Visual Studio project files, so you can just create your CMake file as the origin of platform-specific IDE files. The KDevelop generator is fine, so you can edit and compile in KDevelop (which will in turn call Make).

另一方面,如果你没有什么想法,你可以使用CMake或只是使在Linux上构建事情,如果你想留在你的解决方案文件(这是我正在做的一个带有测试应用程序的库)。这种方法变得复杂,当你的构建过程不仅仅是把这些文件在编译器,让我们看看它做什么,因此,CMake解决方案在我看来是跨平台开发的好东西。

On the other hand, if you have nothing fancy, you can use CMake or just Make to build the thing on Linux, if you want to stay with your solution file (which is what I'm currently doing for a library with test applications). This approach gets complicated when your build process is more than just "throw these files at the compiler and let's see what it does", so the CMake solution is in my opinion a good thing for cross-platform development.

这篇关于如何为Linux构建Visual C ++项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆