How to create and use a HXCPP static library of utility classes in a C++ project

38 views
Skip to first unread message

USam

unread,
Mar 22, 2016, 11:57:21 AM3/22/16
to Haxe
Hello,

I'm trying to figure out how I can use in a Win32 C++ project a set of utility classes written in Haxe and generated in hxcpp.


Let's say we have 2 utility classes: LoggerUtils.hx and GraphicUtils.hx
A static libUtils.lib library containing these classes is generated with hxcpp ( using compilation technique described here: http://wighawag.com/blog/2014/12/hxcpp-externs/)
The Win32 c++ project compiles and links fine against libUtils.lib and the corresponding .h files.


- Is is possible to directly use the generated LoggerUtils_obj and GraphicUtils_obj classes to instantiate and invoke utils objects on c++ project main() side? 

- If not, what is the recommended method?

- If cpp<->hx glue classes must be used to communicate with the Haxe side can they be generated automatically by the Haxe tools?

- Is it possible to generate a lighter hxcpp static library only containing the cpp classes without the Haxe main(), hxRunLibrary() and GC stuff?



Any help or samples would be greatly appreciated.

Thanks!






Reply all
Reply to author
Forward
0 new messages