【发布时间】:2012-04-16 02:53:47
【问题描述】:
我正在尝试使用 Haxe 中的 Windows API 创建 Windows 应用程序。我已经使用 ndlls 和 Haxe/Neko 完成了这项工作。
我尝试使用 cpp 目标执行此操作,其中我使用 Haxe 2.09 中的新宏功能将 C++ 代码嵌入到 Haxe 文件中。但是,只要我包含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 或 DirectX SDK 中的任何头文件替换 windows.h,我会得到同样的错误
我正在使用 Haxe 2.09 和 FlashDevelop。我使用的是 Windows 7。我也在使用最新版本的 hxcpp(2.09 版)。
【问题讨论】: