Skip to main content
GameDev.net gamedev.net
🔒 Locked 🤖 Godot

Visual C++ (VS.NET 2003)

Started by ToohrVyk Dec 21, 2005 at 7:49 AM 3 replies 750+ views
Original Post
ToohrVyk
ToohrVyk
I have a nice little development environment going on:
  • [EDIT: done] a batch file that, when run, compiles and links my entire program. I didn't write it (it came with the library I'm using).
  • a batch file that, when called with a module name as argument, creates the files (modules/$1/$1.cpp; modules/$1/$1.hpp; modules/$1/unittest.cpp;) for that module, performs whatever includes are necessary for the unit test file and creates some base code in the files using the module name. It also registers the new module for compilation.
  • [EDIT: done] a batch file that runs the game with the correct arguments and values (also came with the library).
  • several other batches to compile game resources into a *.pak, and to upload the game to an embedded device.
  • [EDIT: I'll keep using TortoiseSVN] a nice SVN repository on my local server.
I'm finding it a shame that I'm only using Visual Studio as a text editor. Because of this, I would like to integrate/re-create the above operations into Visual Studio, and to be able to use the integrated debugger and also (if possible) a profiler adapted to my compiler. However, I only want to do this if it does not take me too much time. And since I'm not extremely familiar with Visual Studio configuration, I would like some help with this. So my question is twofold: - How do you quickly and easily configure Visual Studio to do the above? - How can I use a debugger and a profiler? The compiler and linker used by my current framework are: Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 Microsoft (R) Incremental Linker Version 7.10.3077 Thank you for your help. [Edited by - ToohrVyk on December 21, 2005 8:43:28 AM]
ToohrVyk
ToohrVyk
I've actually tried to do this. Visual is an excellent tool, I implemented the running and building batches using an NMake project. I also decided to keep using TortoiseSVN (since I have to manage graphic assets as well).

So, my questions only remain for the creation (and adding) of files to the
project, and for the debugging/profiling parts.
DrEvil
DrEvil
You can build a visual studio project/solution from the commandline with the normal solution file. Don't need an nmake to do that.

For adding files to the project you're probably going to need to set up a macro.

If you go to tools->macros you should be able to record a macro of importing files into the project, then alter the source that the macro creates to take the filename as a string or something.

For game resources, you can make a folder in one of your projects called Scripts or something, import .bat scripts or some other executable/tool you want to run. Right click on the file and go to properties. Under custom build step you can give the file a command line to run and stuff. Then at any time later you can right click on the file in visual studio and click the compile button and it will run the bat file or executable or whatever you set that file up to do. Normal builds I believe will run these custom build settings as well.

Alternately you can go into your project settings and fire off a packaging utility as a post-build step, so it only happens after the project successfully builds. Project Properties/Build Events/Post build events. I commonly use post build events to copy dlls to game folders or wherever they are needed. You can also set pre-link and pre-build events do do stuff.

Hope that helps?

Edit: Here's a .bat file I use to build Ogre3d from its solution

call "%VS71COMNTOOLS%\vsvars32.bat"
devenv ".\ogrenew\Ogre.sln" /build Debug /out Ogre_Debug.txt
devenv ".\ogrenew\Ogre.sln" /build Release /out Ogre_Release.txt
ToohrVyk
ToohrVyk
That's useful indeed. I'll have to look closer at that macro idea, but the general details appear to be working correctly.

++rating.
ToohrVyk
ToohrVyk
[Moved to another thread]

[Edited by - ToohrVyk on December 21, 2005 12:23:57 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.