views:

189

answers:

2

This may sound like a newbie question - and it is. I'm relatively new to vs, we started using it a few months ago, and I still haven't "mentally" made the change from the command line. So, if you could help me with 2 things:

  1. I create a new project (not a solution). He puts the files in some directory. After putting my code inside it, I click on the little green triangle (Debug, it says), and he compiles it, builds it and runs it. It works ok. Now, sometimes, I have to change only a tiny bit of code and I don't feel like getting the whole VS up just for that. How can I do that Debug thing from the command line, with the assumption I didn't change anything else.
  2. Where do I tell him not to create a "Debug" subdirectory, not to create a HTML Build log, an object file ... and so on, generally, where can I find the settings which will help me to get as little files ... apart from my original source, and the .exe resultant one ?
+2  A: 

I have to change only a tiny bit of code and I don't feel like getting the whole VS up just for that. How can I do that Debug thing from the command line, with the assumption I didn't change anything else.

I think what you want here is not debugging but a rebuild of your project.

Where do I tell him not to create a "Debug" subdirectory, not to create a HTML Build log, an object file ... and so on, generally, where can I find the settings which will help me to get as little files ... apart from my original source, and the .exe resultant one ?

The answer to both these questions is to use the command line! You can make VS emit a make file from the loaded project. Use NMAKE to build this make file after you have made your desired modifications. The ".obj" files are created as an intermediate step between compilation and linking phase this is how the C++ compilation model works. Why do insist on not generating them?

SDX2000
1. Yes.2. I forgot, I'm not doing it in C but in fortran (Intel's visual fortran compiler - it integrates nicely into VS). OBJ files, I don't need them. And I like having as few files as possible. Preferably nothing but for,f90,exe and that vs project file which enables me to open it in vs.
ldigas
I don't think VS has had the option to generate a makefile for a project since VC6. It's kind of irritating. You can do a command line build using the 'devenv' command.
Michael Burr
+1  A: 

You can't really start debugging without starting up Visual Studio, since Visual Studio is the debugger. You can tell VS to rebuild a solution from the command line without firing up the UI if you want to just build it: See MSDN for details.

You can control the creation of the DEBUG and RELEASE directories via the 'intermediate files' option in the project settings. Though you need to create the obj file somewhere in order for the compile to work.

Rob Walker
Can I somehow put in the intermediate files (which, I gather, serve as pseudo-makefiles) for upon rebuilding to automatically delete obj files ?
ldigas