16

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.

jww
  • 97,681
  • 90
  • 411
  • 885
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305

4 Answers4

13

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.

zmbq
  • 38,013
  • 14
  • 101
  • 171
  • what if I just install Eclipse in Linux and then file by file copy everything to Eclipse? recreate every project, every file, by hand, and just copy content? In Eclipse can I create "static lib" project and then refer it in another project? – Oleg Vazhnev Sep 14 '14 at 08:17
  • I have no idea. I've never used Eclipse for C++ development, and when I used it for Java I hated it. – zmbq Sep 14 '14 at 08:51
6

Use xbuild? So if you install Mono, then you have xbuild which is the OSS version of msbuild. You can just build your .sln file by something like "xbuild solution.sln"

Nikhil
  • 61
  • 1
  • 1
  • Now deprecated. Appears to be replaced by `msbuild` https://www.mono-project.com/docs/about-mono/releases/5.0.0/#xbuild – Colton Apr 22 '19 at 05:56
0

Clion can generate cmake file automatically for .sln project under linux.

Chen Li
  • 4,824
  • 3
  • 28
  • 55
-1

If your code is not dependant on any Window specific library then you can use make the utility to make any lib, bin.

You can also provide different rules to link your library based on your specific requirement. You can also link third party library using Make utility.

Unihedron
  • 10,902
  • 13
  • 62
  • 72
Neelendra
  • 7
  • 1