Build Process for a Visual C++ 2008 Express Project - c++

I have a VS 2008 C++ project, with one very small and simple code file. I need to write an app to generate this file and build the project into a Win32 DLL. I will need to deliver a free compiler etc. with the app to my client, so I can't automate VS to do this.
How would I best go about this?

VS 2008 Express installs the command line compiler (in fact the installer has an option so you only get the command line stuff). So getting a free compiler is no problem.
If you really only need to build a single file into a DLL, a cl command using the '/LD' option should be enough to do the trick (though you'll likely need at least a couple other options).
If you want to get fancy, I'm not sure if The Express SKU includes nmake.exe (but I imagine it does).

Related

Has anyone successfully modified vcvars*.bat in Visual Studio to point to a shared build tools location and been able to use MSBuild?

Our group has some simple regression machines that build different C++ code bases regularly, and they all use different versions of the Visual Studio build tools. Rather than try to install a lot of different versions of Visual Studio on the build systems, the tools are copied to a standard mounted location and used from there.
Now, the team that set this system up uses a custom build system rather than MSBuild, but I am trying to use these machines with MSBuild (which is also copied to the mounted location) to build an existing VS solution file. Does anyone know how to modify a vcvars batch file enough so that these tools being in an alternate locations will work properly without having to install anything to the build node?
Not sure what point you want to describe. And as far as I know, you can just download the msbuild open source code and then basically add your custom build tool to the msbuild code.
In this way, the generated new msbuild tool is perfectly embedded with your custom tool. This is the best solution.
Simply changing the vcvars*.bat and other related files on the msbuild folder of vs2019 is not helpful. You must start at the stage of msbuild development.
And thanks for Microsoft to open up the source code of msbuild, in fact, this is to facilitate users to embed custom tools.

How to package/send a program (Visual Studio 2013)

I would like to send a program I've been working on to a friend so that he can test it for me, but I don't know exactly how to do so. Should I just put the release folder in a .zip file and send it to him like that, and tell him to run the .exe? Or is there an installer that I can sort of "package" it in?
I've created a C++ program using Visual Studio 2013 on Windows. Thanks for your help.
If you zip it up they may need additional runtime libraries installed (VC redistributables) on their OS. You can also use installer software to help manage this. Which one you choose is up to you but zipping it up may be the easiest way if they're willing to manually install the required VC Redistributable package. Just make sure you include all dependencies your application requires to run.
Keep in mind that the debug version of the VC runtime is not part of the redistributable package and cannot (legally) be deployed. You will need to send them Release mode versions of the application.
I would suggest using
gisthub.com
You can easily post loads of code, public/private and can share the link
easily with anyone you like.
Also:
You could send the actual file of your program to him,
but for him to use it he would have to have the EXACT same
integrated development environment(IDE) as you.
For Example:
Microsoft Visual Studio 2013

Makefiles, moving from VC6 to Visual Studio 2010

I'm trying to migrate some projects from VC6 to Visual Studio 2010 but I'm running into issues with makefiles - at the moment they don't work! (Which was expected).
Any ideas or pointers how they should be written now (before it was a line beginning with msdev... which cannot be found now, is there an up to date equivalent to use? I read about vcbuild but I believe this is not present in VS10).
Is it possible to just build a whole project in one line?
i.e. the current line to build is:
msdev project.dsp /MAKE "$(component) - Win32 Release" /build
Any ideas what this would change to?
VS2010 no longer uses DSP style projects. The project file format has changed radically since VC6. The extension now is vcproj, not dsp.
Your best bet is to migrate the project to VS2010 format by opening it in the new IDE, and make sure it builds and runs OK there. Note that some working VC6 code will not compile in VC10 since the newer compiler is strongly conformant, while the old was not. Then, try the command line build using the resulting project.vcproj file.
I'm not sure if VS2010 will recognize and import VC6 projects. If not, then you can use Create Project from Existing Code to create a VS2010-style project from your source. This is going to be harder than just opening the old DSP file, but still easier than manual migration of all the DSP settings into a valid VS2010 vcproj file. If you are on VS2010 Express, then even this is out since that option is only in paid versions.
The VS2010 app name is devenv. From the command line, as long as you've run the right vcvars32.bat file, just type devenv /? to get the command line build help. Essentially, it's:
devenv solutionfile.sln /Build "Release"
So once you upgrade your projects and create a solution, you should be ok. There may be a way to build a project without a solution file, but I don't know how to do that.

Simultaneus development in Visual Studio and a Linux IDE

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/

Cygwin in Visual Studio

I'm trying to port an old program I wrote for class from KDev in Ubuntu to Windows Visual Studio 2008 using Cygwin as a personal learning exercise. I have the include path configured to include C:\cygwin\usr\include but it doesn't read the .h files properly.
Namely I'm curious as to how one would go about using unix sockets.h functionality in a Visual Studio environment using Cygwin. Has anybody ever got this working or have an easier way to go about doing this?
There are several ways to go about this that could be made to work, depending upon your exact goals. The simplest way is probably just to create a Visual Studio "makefile" project that fires off a custom build command to run a makefile you've built. But that keeps you away from a lot of the nice benefits of Visual Studio as an IDE, so I'm guessing that's not really what you're after.
If you want a more fully integrated solution, you're going to need to do two things. First of all, you're going to need to change out all of your include/library paths to avoid the Microsoft ones and go after the Cygwin ones instead. You can do this by selecting "Tools->Options" from the menu, then choosing "Projects and Solutions->VC++ Directories" from the tree on the left hand side of the window that comes up. You'll have options to change the search directories for executables, headers, libraries, etc. For what you're trying to do, I'd suggest removing everything and adding in just the cygwin directories.
Second, you'll have to tell Visual Studio to use the gcc/g++ compiler. This is a bit trickier. VS supports custom build rules for custom file types... but it seems to have C++ hardwired in for the Microsoft compiler. I don't really know a great way around that except to use your own custom file extension. You can try the standard unix extensions of .c (C files) and .cc (C++ files), but I suspect Visual Studio will automatically pick up on those. You may have to go with something totally foreign.
If you right click on your project in the Solution Explorer and select "Custom Build Rules" you'll be given an interface that will let you create your custom build rules for the file extension you've chosen. The interface is relatively straightforward from there.
This might not get you exactly what you wanted, but it's probably about as close as you're going to get with Visual Studio.
Simply speaking, don't do that. It would be just waste of time. I tried it several times, but always failed. Mostly, I was frustrated by many linking errors, and also was unable to use VS as a debugger.
You can use Visual Studio for editing and browsing source code. It is nice because VS provides the best C/C++ intellisense features (e.g., Auto completion, fast go to definition/declaration). But, it is very hard to use cygwin tool chains with Visual Studio 2008. Visual Studio 2008 is not designed to work with other tool chains. Specifically, you need to change (1) headers, (2) libraries, (3) compiler and (4) linker. However, it is generally very hard, or you need to trade off with the nice features of Visual Studio.
The strongest feature of Visual Studio is its debugging ability such as fully integrated debugging environment and very easy watch windows (e.g., you can see STL vector's element directly in watch windows). However, you can't do this if you would change fundamental tool chain (although I am very suspicious it is even possible to safely build with Visual Studio and cygwin tool chains).
Unfortunately, current Visual Studio 2008 is not for cygwin/MinGW.
This is an old question, but since it comes up first (for SO) on a Google search I wanted to share that it looks like the latest Visual Studio versions do support this.
For instructions, refer to this blog post:
https://blogs.msdn.microsoft.com/vcblog/2017/07/19/using-mingw-and-cygwin-with-visual-cpp-and-open-folder/