Unable to use BitScanForward64

I am building a chess engine in C ++ that uses bits (__int64s), and I need to use BitScanForward64 for some calculations. But when I call it, I get this error:

error C3861: '_BitScanForward64': identifier not found

I include it like this:

#include <intrin.h>
#pragma intrinsic(_BitScanForward64)

Same thing with BitScanForward64.

I am using Visual Studio 11 on Windows 7 (64 bit). Processor: Intel Core i7-2600K

I have not done many projects with C ++ before I do not know why this is happening. Please, help!

+3
source share
1 answer

_BitScanForward64 is only available in x64 builds. If you are targeting Win32, _BitScanForward is the only internal available.

+5
source

All Articles