How to create a Visual Studio Solution for Linux?

I always used Windows, had very limited experience with Linux.

My Visual Studio solution contains 5 C ++ projects - 4 of them are static libraries, and one is the main application (using these static libraries), I want to move it to Ubuntu.

I do not use any code specific to Windows, so with a few changes I have to be compiled under Linux. How to do it? What kind of software should be used on Linux? What should I do with static libs, should I use static libs on Linux? How to convert a Visual Studio solution to something like Linux?

upd What if I just download Eclipse to Linux and then file by file, project by project, recreate and copy everything from VC ++ to Eclipse? this should work, right? I have only 100-200 files, so you can do it manually.

+6
source share
3 answers

I can think of two reasonable options. The first is to create a makefile that will compile everything for you. Once there was a utility called Make It So that did this automatically. Their page indicates compatibility with Visual Studio 2010, it can also work with Visual Studio 2012.

You can also use cmake . This is a bit more about getting right, but the end result will be the ability to compile your code more or less anywhere.

+8
source

Use xbuild? Therefore, if you install Mono, you have xbuild, which is a version of msbuild OSS. You can simply create your .sln file with the "xbuild solution.sln"

+3
source

If your code is independent of any particular Window library, you can use make to make any lib, bin library.

You can also provide different rules for linking your library based on your specific requirements. You can also link a third-party library using the Make utility.

+1
source

Source: https://habr.com/ru/post/975249/


All Articles