Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Visual Studio Solution under Linux?

I was always using Windows, have very limited Linux experience.

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

I do not use any windows specific code, so with minor changes I should be abble to compile under Linux. How to do this? What exactly software should I use under Linux? What should I do with static libs, should I keep using static libs in Linux? How to convert Visual Studio solution to something Linux-like?

upd what if I just download Eclipse in Linux and then file by file, project by project, recreate and copy everything from VC++ to Eclipse? this should work, isn't it? I have just 100-200 files so it's possible to do this by hand.

like image 987
Oleg Vazhnev Avatar asked Sep 14 '14 07:09

Oleg Vazhnev


People also ask

How do I open a Visual Studio solution in Linux?

Select File > New Project in Visual Studio, or press Ctrl + Shift + N. Select the Visual C++ > Cross Platform > Linux node, and then select the project type to create. Enter a Name and Location, and choose OK.

Can I use Visual Studio on Linux?

According to your description, you would like to use the Visual Studio for Linux. But the Visual Studio IDE is only available for Windows. You could try to running a Virtual Machine with Windows.

Can MSBuild run on Linux?

MSBuild for LinuxInstalling the pre-built binaries is easy—just grab the . NET Core SDK for Linux (https://dotnet.microsoft.com/download). If you are adventurous and want to compile MSBuild from source, you can find the project at GitHub (https://github.com/dotnet/msbuild).


1 Answers

I can think of two reasonable options. The first one is to create a makefile that will compile everything for you. There was once a utility called Make It So that did this automatically. Their page specifies compatibility with Visual Studio 2010, it might work with Visual Studio 2012 as well.

You can also use cmake. It's a bit more involving to get right, but the end result will be the ability to compile your code more or less anywhere.

like image 142
zmbq Avatar answered Oct 13 '22 20:10

zmbq