私はC言語で全く新しいことを書いています。バイナリ操作を実行するヘルパーDLL(C#から呼び出される)を作成しています。私は '識別子' BitScanForward64は "定義されていません"エラーが発生します。 32ビットバージョンが利用可能です。 Win32 DLLを作成したからです。Visual Studio 11 Developer PreviewでのBitScanForward64の問題
その後、64ビット版は特定の64ビットDLL(私は新しいプロジェクトウィザードでは「一般」と仮定します)にしか使えない可能性があり、別の32ビットと64ビットのDLLが必要になることがあります。この場合、またはBitScanForwardとBitScanForward64の両方の組み込み関数を実行するDLLを1つ持つことができますか?その場合、どうすればそのDLLを作成できますか?ここで
は私の現在のコードです:
// C Functions.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
//#include <intrin.h>
//#include <winnt.h>
int _stdcall LSB_i32(unsigned __int32 x)
{
DWORD result;
BitScanForward(&result, x);
return (int)result;
}
int _stdcall MSB_i32(unsigned __int32 x)
{
DWORD result;
BitScanReverse(&result, x);
return (int)result;
}
int _stdcall LSB_i64(unsigned __int64 x)
{
DWORD result;
BitScanForward64(&result, x);
return (int)result;
}
int _stdcall MSB_i64(unsigned __int64 x)
{
DWORD result;
BitScanReverse64(&result, x);
return (int)result;
}
はい、x64またはItaniumはMSDNページに記載されている必要があります。 –
これで2つのDLLが必要になります。 64ビットDLLを作成するにはどうすればよいですか?それはオプションではないようです。 – IamIC
@IanC:http://msdn.microsoft.com/en-us/library/9yb4317s(v=VS.100).aspx – Necrolis