My background is Linux and traditional makefiles. I have a project where the makefile builds several dozen executables I can then run to perform tests against the library being developed. This library is now ported to Windows.
My question: In Microsoft Visual C++, do I have to create a new project for every individual test .exe file? Or is there a way to create 1 project that will easily build all of the .exe files? E.g., test001.cpp becomes test001.exe, test002.cpp becomes test002.exe, etc.
I'm using Microsoft Visual C++ 2010 Express. Right now what I do is click on File->Add->New Project...->Win32 Console Application->... for every test executable. But it would be nicer if all these test files could be built without a new project for each one.
You need to have one project per executable, but you can have multiple projects per Visual Studio "solution".
When you build a solution, all of its projects get built. If you need the projects to be built in a specific order within the solution, you can easily set up dependencies.
If you're using Visual Studio in the normal fashion, then yes, each VS project (i.e. each .vcproj file) corresponds to exactly one output file (an executable, DLL, or static library).
You can also use Visual Studio with makefiles though, if you want. Just write your makefile as usual, except the C++ compiler is the cl.exe in the VS binaries directory, the linker is link.exe, and of course all of the command line flags are completely different. You can even set your VS project to use make instead of its built-in system, so you can still use the IDE for editing and debugging.
Related
I have a large C# project which includes a number of IronPython scripts. These scripts are called using the Microsoft.Scripting.Hosting facility. Within the Visual Studio solution the Python scripts are all kept in their own Project.
If I edit one of the scripts and Run the solution, all my C# code is compiled as needed but the IronPython code is from before my edits. To force the compiler to use my new scripts I need to use Build | Rebuild Solution.
Is there some way to instruct the compiler to consider and recompile the IronPython scripts when the solution is run?
I'm new to VS, coming from the Mac where I used the excellent CodeKit for LESS compiling. I've installed the Web Essentials add-on, so I have basic LESS support and compiling.
The major shortcoming with this plugin is when saving files that are imported into a main.less file, the main.less file does not compile unless I open it specifically and save it.
I'd prefer a solution like CodeKit, which would compile the parent file if any of the children are modified. Are there any other plugins, even commercial ones, which do this?
There's an option in Web Essentials to "compile all LESS files", which would almost do what I want, but it throws an error:
In WebEssentials there is an option (tools>Options>WebEssentials>Less) to Compile all files on Build, which you'll probably do before publishing anyway. You might want to add your votes to the UserVoice ticket for this issue.
BundleTransformer allows you to have ASP.NET do the transformations on the fly (at runtime), having it compile, minify and compress all in one go. You won't have to recompile your files inside Visual Studio itself. You can keep using WebEssentials for intellisense.
And then there is the Mindscape Web Workbench which provides similar functionality as Webessentials. Their Pro edition ($) can also compile files on save & build.
I personally prefer http://wearekiss.com/simpless You can use it even in Express edition since it's not integrated inside VS.
Just open the Simpless drag and drop the file and it will compile your file automatically when they has been modified from your VS (or any of editor).
Web Essential is also have suggest in someone answer.
I'm attempting to use Eclipse (CDT) in order to make a portable C++ makefile project that I can take and compile on different platforms. I'm settings up build configurations to use each platforms native compiler. For Windows, this means Visual C++.
I'm running into two separate issues, at the moment. The first one is that I can't get Eclipse to recognize the include path I'm trying to work with. On my computer, I have the compiler located at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include. I went into my project settings under my Windows-specific build configuration and I added that to C/C++ General -> Paths and Symbols -> Includes -> C++ Source File. Eclipse still complains that it cannot find the files I'm trying to include.
The second problem I'm having is that make cannot find the compiler executable. I'm using a copy of make installed through Cygwin, which may or may not be the problem. I was wondering if there was a make-like program for Windows that I could use to build my project for Windows.
Sorry for the two questions in one, I just thought it'd be easier to kill two birds with one stone.
I am learning how to build games in Visual C++ and when I upload them so friends can check them out, they all end up with messages saying it can not run. I did some research and found that it is because I am compiling against a Dynamic library instead of a static library. Correct me if I am wrong anywhere please. Upon further research, I found that a lot of people do not advise going this direction but instead include the files needed by my game.
How would I go about distributing my games to friends and make it real easy for them to just open up my .exe and play the game?
If you link to any DLLs, you also need to ship those along. If you produce a single .exe in your output, you probably need your friends to install the MS Visual Studio redistributable package for your version of visual studio. This is an example link for the VS 2010 one, but the one you give your friends should match your version.
There are essentially two options: Keep everything as-is and provide them with the runtime files (also named Microsoft Visual C++ * Redistributable Package or similar; the * has to be replaced with your version, e.g. 2005, 2008 or 2010). Downloads can be found on Microsoft's download site as well as in your Visual Studio installation folder (look for a folder called "Redist").
Alternative solution: In your project settings you're able to select the runtime environment (under linker options). Change your release build to use "Multithreaded" instead of "Multithreaded-DLL".
I inherited a project setup from a previous programmer. He used to develop for linux, but instead of coding directly in ubuntu, he shared the drives with samba and used Visual Studio to edit the files.
Now I can't compile this project in Visual Studio directly obviously, so I can't get data for intellisense and such. Would it be possible to associate symbols without compiling?
I know that what I ask seems counter intuitive, but Vim plugin OmniCPP does not come with a compiler and yet, is able to provide code completition up to a certain degree.
The commercial addin Visual Assist X can help. How well it helps is dependent upon how much information it can get from the project (if one exists): things like source files, header files and include directories. If no project is being used, you can create a dummy project just as a container to associate source and header files (not for compiling).