compiling make files in visual studio 2003

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

kaustubh

compiling make files in visual studio 2003

Post by kaustubh »

I have visual studio 2003 how can i compile make files inside it.
User avatar
Bo Persson
Posts: 243
Joined: Sat Mar 11, 2006 8:31 am
Location: Malmö, Sweden
Full name: Bo Persson

Re: compiling make files in visual studio 2003

Post by Bo Persson »

You don't. :-)

You can either use the make file, and run NMAKE from the command line, or create a project in Visual Studio and add the files to the project.
kaustubh

Re: compiling make files in visual studio 2003

Post by kaustubh »

For example i want to compile crafty what type of project i should make , should i make empty project or win32 console.

Kaustubh
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: compiling make files in visual studio 2003

Post by mjlef »

A win32 console (or win64 if your compiler supports that).
davehore

Re: compiling make files in visual studio 2003

Post by davehore »

It depends on which program you want to build.

Fruit you can build in MSVS by just adding all the files to a C++ project and running it (F5 - no makefile needed, debugging works fine etc).

To compile Crafty with MSVS you need to:

1. Start a Visual Studio command prompt, not a normal Windows one.

2. In the crafty directory, there a few Makefiles. You need to make sure the one for Windows is called 'Makefile', with no extension.

3. At the command line, in the crafty directory, use the commands 'nmake clean' followed by 'nmake'

This should build crafty. If you want to attach the VS debugger to step through code you modify the makefile to use the debug flags (it explains how in the comments in the makefile). Then run crafty normally after building it and in VS with the source files added to a project use the Attach to Process command.

Good luck :-)

Dave
davehore

Re: compiling make files in visual studio 2003

Post by davehore »

Also meant to say - it does not really matter which type of VS project you use.

For crafty, when you compile from the command line it will ignore the project file. To use a project for debugging, or for Fruit, an empty project with all the source files added should be fine. The Win32 project just adds some preprocessor directives and stuff that not used by these programs since they are written to run on non-windows platforms.

Hope that makes sense - it is getting too late.

Dave