1

How do you manually set switches when you are compiling Stockfish in Visual Studio?

In the type.h file it saids:

When Makefile is not used (e.g. with Microsoft Visual Studio) some switches need to be set manually:

-DNDEBUG | Disable debugging mode. Always use this for release.

-DNO_PREFETCH | Disable use of prefetch asm-instruction. You may need this to | run on some very old machines.

DUSE_POPCNT | Add runtime support for use of popcnt asm-instruction. Works | only in 64-bit mode and requires hardware with popcnt support.

-DUSE_PEXT | Add runtime support for use of pext asm-instruction. Works | only in 64-bit mode and requires hardware with pext support.

I just want to where where/how do you put these "commands"?

  • This is just off-topic. – SmallChess Jun 5 at 18:16
  • sorry, do you know where i should move the thread to? – user23783 Jun 5 at 18:27
  • also im just wondering, how is this off topic? i just want to know so i can prevent this from happening again in the future. – user23783 Jun 5 at 18:32
  • Compiling C++ source code shouldn't be on-topic but I could be wrong. Let's leave the community to decide. – SmallChess Jun 5 at 18:33
1

This question should be in programming.

These can be put in a top h file, the best being stdafx.h. Just include "#define DNDEBUG",

They can be added to the command line/compiler commands. Under VS6, Project->Settings (Alt+f7), there is a box to add project settings under the c/c++ tab.

| improve this answer | |
  • I can't seem to find stdafx.h. Do you know where it is? Also do you know what the name of the box that I can add project settings to? – user23783 Jun 5 at 18:55
  • Stdafx.h is automatically created when you make a new project, so that wouldn't be included in the download, my error. (When I began, I always had the error that the compiler couldn't find stdafx.h and just created a dummy workspace and added code as a project.) I have the debug option in the "Project Options" box, so I assume that would be correct. – Mike Jones Jun 5 at 22:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.