Haxe で Windows API を使用して Windows アプリケーションを作成しようとしています。ndlls と Haxe/Neko を使用して既にこれを行っています。Haxe 2.09 の新しいマクロ機能を使用して、C++ コードを Haxe ファイルに埋め込む cpp ターゲットで試してみました。しかし、含めるとすぐにwindows.h
エラーが発生します
./src/Main.cpp(79) : error C2039: 'RegisterClassA' : is not a member of 'hx'
./src/Main.cpp(81) : error C2660: 'RegisterClassA' : function does not take 9 arguments
Called from ? line 1
Called from BuildTool.hx line 1246
Called from BuildTool.hx line 554
Called from BuildTool.hx line 591
Called from BuildTool.hx line 710
Called from BuildTool.hx line 785
Uncaught exception - Error in building thread
Error : Build failed
Build halted with errors (haxe.exe).
ここに私のコードがあります -
import cpp.Lib;
@:headerCode("#include <windows.h>")// if i comment this line or replace windows.h with another standard header file like iostream, the error goes
class Main
{
static function main()
{
//no code here
}
}
実際、windows.h
Windows または DirectX SDK のヘッダー ファイルに置き換えると、Haxe 2.09 と FlashDevelop を使用した場合と同じエラーが発生します。Windows 7 を使用しています。最新バージョンの hxcpp (バージョン 2.09) も使用しています。