I have a project C/C++ in Visual Studio. I have some trouble:
How can i build release version which can run in Linux and MacOSX, of course it have to run in Window.
Thanks
cmake is a usefull tool to complie program write by C/C++,as well as other,recommend you to use.
for how to write a program which could run everywhere,I am considering you need to read some open source project,this is a good start.
Related
We have a large Visual Studio C++ solution that builds on a Windows machine.
We want to build this application on a macOS system and I’ve read that it’s possible by building/deploying remotely to a target macOS machine from a Windows Visual Studio environment.
Can we do that if we have a Visual studio solution with MSBuild projects? Or it is mandatory to have CMake projects to do that? At least for Linux remote building it seems that CMake isn't mandatory.
We also need to build our application in a CI/CD pipeline so we also need to build from a command line, from what I understood I also read that it should be possible but I don't know how maintainable it is.
For anyone interested, it is possible to remote build on Linux/macOS a MSBuild project without converting it to a CMake project.
Follow this topic for more info.
I have a Linux C++ program that I build with GNU Make using the "make" command. How can I convert this to a task.json and a launch.json file for debugging on Visual Studio Code with a WSL
Basically the title. I have a directory that I use in Linux, and simply use the "make" command to build my program with a Makefile. But I need to move to Visual studio, I have managed to get it working in the sense that I can now edit code in VS and then head back to my terminal to "make" again and test but debugging in command line with gdb is not fun so I would like to be able to do it in VS but am having trouble configuring the .json's to get it to build and run and debug correctly.
The build only actually generates .exe's which then would need to be run with the debug setting on.
Any help greatly appreciated!
EDIT: In fact I basically just want Visual Studio Code to be able to debug my program. To build it I actually need to run 2 .sh scripts and then the make file. Is there a way I can make this happen in VSC using the build option and then debug it?
Not 100% sure what you are asking but I am assuming you run Visual Studio Code on Windows and need to compile and debug a program with the Windows Subsystem for Linux (WSL).
You can do that with the remote development extension. The Visual Studio Code C/C++ extension also supports remote development.
This works for WSL but also for compiling and debugging on a Linux server (using SSH).
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.
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/
I consider an option to use Eclipse as an cross platform IDE for C++ code on Linux and Windows.
Is it possible to set Eclipse to compile code with Visual Studio C++
(don't think it's relevant but Eclipse project files will be created by cmake).
Is it possible to debug from Eclipse application compiled by VS C++ compiler?
Is it possible to debug on Linux from Eclipse application compiled by g++?
What C++ IDE you prefer for Linux - Eclipse, Kdevelop or there're other alternatives?
Thanks
Dima
No as far as I know. The alternative would be wascana project. Now that the new version of MinGw has been released and it uses gcc.4.4 I think that wascana will be able to compete against Visual Studio, but we still have to wait to the next release of wascana.
No as far as I know. Again wascana could be an alternative.
Sure, try cmake -DCMAKE_BUILD_TYPE=Debug -G"Eclipse CDT4 - Unix Makefiles", build your project and create a debug configuration with eclipse. I've done it before with no problems at all.
I move from Emacs to Eclipse. I remember I evaluated Kdevelop but I discarded it for reasons unconnected to Kdevelop's quality itself. So I cannot give you my opinion. Another C++ crossplatform IDE is Code::Blocks, but I have never used it.
I do some C++ with Qt cross-platform development in Linux, Windows and Mac and I found Eclipse to be too heavy an environment to work with. As an IDE I preferred Qt Creator.