Simultaneus development in Visual Studio and a Linux IDE - c++

I am trying to get started with an existing open source project (QuantLib) using Linux operating system. However it seems that most developers use Visual Studio (judging from the project files committed with the source).
Which Linux C++ IDE would be most compatible with VS project files? Is there a way to import/export them, so that I don't have to create my own projects from scratch (and update them every time someone adds a new file)?
EDIT: Its all unmanaged code

In my experience, the best method for doing dual-development on Linux & Windows is to throw away the existing Visual Studio project files and, instead, use CMake to generate the platform-specific build environment. It's capable of outputting Nmake makefiles (for command-line Windows builds), Visual Studio projects, and Linux makefiles. The documentation leaves a bit to be desired but once you have it up and running, it's very easy to maintain.

The FAQ provides installation instructions for MinGW. It seems that there is a GNU Makefile included, so you don't need to mess with Visual Studio project files.

Aparantly they they only build on MAC and Windows.
Instructions here: http://quantlib.org/install/macosx.shtml
But since MAC is basically BSD Unix it should be identical (or with little trouble) to get it up and running on Linux.
The following should work (though you may need to look at the configure options)
1) Install Boost.
2) ./configure
3) make

You'll definitely want to check out Mono, it might be just what you're looking for: http://monodevelop.com/

Related

Cross Platform c++ and Visual Studio 2017?

Is it possible to compile c++ project for Windows, Mac, Linux in Visual Studio 2017?
If not please give me a best way to compile for cross platforms.
No. It is not generally possible to do that with Visual Studio.
In my opinion, the best approach is to configure your CI system to spin up virtual machines running those other operating systems and then perform the build natively in the VM using whatever compiler those systems provide (like GCC & Clang). With the help of a build system like SCons or CMake you can abstract away most of the platform specific compiler bits.
A bonus is that building your code (and running your tests) with multiple compilers is a good way to find bugs.
Visual Studio 2017 added support for building and debugging for Linux, either on a remote machine or using some new built in local subsystem.
A fully cross-platform solution for you, porting your existing projects from VS could be as follows:
Start by converting your entire solution tree to a CMake project (VS 2017 fully supports loading such a project instead of the MS project format of the .sln and .vcxproj files). You can try a conversion tool like this one.
Now that you have a CMake project you can use the CMake build system directly from any other platform. For example on a Virtual Machine running your target OS. There, all you need is configuring your CMake project to build with clang/gcc instead of msvc.
If you prefer staying closer to home for now, in terms of editor/IDE that can be configured to build from the GUI -- kind of like the VS you're used to -- look for a cross-platform editor that supports CMake projects like VS Code.

Where is cl.exe? (MS Build Tools ’13)

I just want the VC++ compiler, since some C++ graphics libraries (I'm planning to use and learn bgfx...) require it for compilation. For this I’ve downloaded and installed Ms. Build Tools ’13. However, I can’t find it.
My attempts:
1) I’ve ran Windows Command Prompt using the Batch input cl and it echoed 'cl'is not recognized as an internal or external command, operable program or batch file..
2) I’ve searched for a file with filename cl.exe on both "C:\Programs Files" and "C:\Programs Files (x86)" paths recursively and nothing. There’s no top folder related to MsVC++ or VC++ too, on the disk.
I cannot try to install Build Tools ’15 (nor VS) since the installer downloads at minimum 3 gygabytes and my network isn’t good.
Where can I find the compiler? Otherwise, is there any cross-platform graphics library (at least for Windows and Mac) that doesn’t need MSVC++ (e.g., just G++), please?
As a commenter mentioned, the Microsoft Build Tools 201x include tools to build managed apps (i.e. .Net apps), not native C++ apps. That's the answer to "where is cl.exe?" It's not there. It was never there.
That's true for the Microsoft Build Tools 2015 too, despite what you think and said. You're mixing up Microsoft Build Tools 2015 and Visual C++ 2015 Build Tools. Note the "C++" there (and the order of some of the words).
The Visual C++ Build Tools are the supported and recommended way by Microsoft to Build visual C++ projects without installing Visual Studio.
If your problem is internet connection get someone else to download it for you, seriously. You're really looking at it the wrong way.
Another alternative is the Enterprise WDK. It's "only" 1.9GB.
Otherwise, is there any cross-platform graphics library (at least for Windows and Mac) that doesn’t need MSVC++
Yes, you should be able to use modern OpenGL in a cross-platform way under Mingw using
GLFW (since it's a CMAKE compile-it-yourself library) and the excellent GLAD for handling loading of the modern openGL API on windows.

Compiling a C++ project in Visual Studio 2015 created in Linux containing make file

I have some C++ projects/programs which are created in Linux and containing make file as well.
I am using window 7 and visual studio 2015. Today I just installed Ubuntu Linux in virtual box BUT do not really know how to start with and run these programs.
What is the easiest way to run theses projects?
I am very new in C++ programming so a detailed answer is needed.
If you want to work in Visual Studio on Windows a good choice would be Visual C++ for Linux Development (VCLinux) : see tutorial here
The tutorial creates a Visual Studio (VS) project that builds with MSBuild (VS's internal build system). However you can also create a makefile project that will build with make. MSBuild is easier to work with if you know VS or have an existing VS project, make is more flexible and might be the best choice given an existing makefile. You should try some simple examples and decide which works for you.

Is it possible to use vs2010 c++ and use Qt for all platforms?

What i hear about Qt, is that it is providing an operating system independent layer.
To do well most tasks a coder normally does. To perform at best the code has to be c++
While there is also mono providing some translation to c++ and there Dot24 an android c# kernel.
Currently the things we do, cannt be done in mono, for hardware reasons.
So i am thinking of going back to pure C++ and QT instead of C#.
Now what i am wondered about
By itself c++ is a standard and should also be idenpendent for linux/windows/unix/microboards/Ce devices etc etc.
But if i would write using VS2010 c++ and QT would i still have advantage my code would run on a wide range of platforms ? . As visual studio, creates a windows based exe? Or should i use also another IDE to write truely independent c++ with Qt?
C++ is a compiled language, whatever IDE/compiler you'll use it will produce executables for a certain platform. But the point of Qt is that, as far as you avoid platform-specific code, your sources can be recompiled on the various platforms, generating a different executable for each supported platform. So, using VC++ is not a limitation as far as sources are concerned.
The limitation comes instead from the build system: Visual C++ uses its own format for project files, which is not compatible with makefiles & co. So, if you started your project as a VC++ project, you would have to re-create manually a Makefile or similar to compile on other platforms.
To avoid this kind of problems, Qt provides qmake, a tool that, provided a .pro file (roughly equivalent to a .vcproj), is able to generate build files for various platforms: .vcproj/.dsp on Windows, Makefile on Linux and OS X, XCode projects on OS X and probably others.
So the point is: you can use Visual Studio, but you should use Qt's build system to be able to port your application to other platforms without any fuss.
Also, you can consider using Qt Creator, which supports directly .pro files, has particularly good integration with the Qt features and works on Windows, Linux and OS X; on the downside, I noticed that the debugger in Visual Studio tends to be way better.
If you have cross-platform C++ code using Qt, you can edit and compile the Windows version using Visual C++ (the compiler that comes in Visual Studio).
Visual C++ still only creates Windows executables, though, so to actually build and run on other platforms, you'll have to get another compiler (but feed in the same source code).
One pain point will be with makefiles: visual Studio has its own project format and cannot process standard makefiles. Neither do other platforms use Visual Studio projects. Visual Studio does come with a tool called nmake which is similar to POSIX or GNU make, but still not compatible except for the most trivial features. And of course cl.exe uses different command-line switches than other compilers. So you'll end up maintaining one set of C++ files but two or more sets of makefiles.
Yes it is possible to develop Qt applications in Visual Studio that can be used on other platforms. For example for my work in medical imaging research, I develop all of my Qt based applications in Visual Studio 2010 with the visual studio project files generated using CMake and at times build some of these applications in linux under QtCreator or KDevelop using the same CMakeLists.txt to generate project files for for these IDEs. As long as I stay away from platform specific code the porting is not that difficult.
In order to develop qt apps qtcreator is the best ide, qtcreator available on linux and mac, so you can open your qt project and build on any platform easily.

Visual studio 2010 project for windows and linux

I'm trying to make a program that works on linux and windows.
I'm writing the program in visual studio in a windows environment.
So I wonder how I could compile my project from visual studio to linux.
The Microsoft C++ compiler is not capable of producing Linux executables.
You will need to use a more portable compiler for your Linux executables, e.g. gcc. Perhaps you may benefit from a cross-platform IDE like Code Blocks or Eclipse rather than Visual Studio.
You should try QT. It is pretty good framework for cross-platform development. The opensource version is free and very well maintained and has the LGPL license. That means you can sell your product as closed source but then you have to dynamically link to QT libraries.
You can use CMake. It will allow you to generate project/solution files for Visual Studio and Makefiles for Linux. This way, you can work using the native tool chain for a platform, while managing a single makefile. However, it's up to you to write portable code and to choose the appropriate libraries for your program to be truly portable.