ammer
ammer copied to clipboard
Can't compile on Windows
I have tried the ammer sample project here in this lib.
I have build the windows dll with success. I can compile to hxcpp and the exe is working as attended. But I can't compile to hl, here is my error:
C:\HaxeToolkit\haxe\lib\ammer\git\samples\poc>haxe build-hl.hxml
Uncaught exception Null Access
C:\HaxeToolkit\haxe\lib\ammer/git/src/ammer/build/BuildTools.hx:76: characters 29-70 : Called from here
C:\HaxeToolkit\haxe\lib\ammer/git/src/ammer/LineBuf.hx:25: characters 5-8 : Called from here
C:\HaxeToolkit\haxe\lib\ammer/git/src/ammer/build/BuildTools.hx:41: lines 41-101 : Called from here
C:\HaxeToolkit\haxe\lib\ammer/git/src/ammer/build/BuildHl.hx:10: lines 10-34 : Called from here
C:\HaxeToolkit\haxe\lib\ammer/git/src/ammer/Ammer.hx:439: characters 9-53 : Called from here
Is there a specific haxe version to use?
Mine is : 4.1.2
That was indeed a Windows-specific bug (and Windows CI is not set up yet…), now fixed. Depending on your installation, just haxe build-hl.hxml
in the poc
directory might not be enough. If that happens, make sure to read the README, which shows the additional command-line arguments you need.
Thanks!
So after executing build-hl.hxml
I tried to execute Makefile.hl.ammer in the output directory with nmake /F Makefile.hl.ammer
to create the hdll but it doesn't seem to work.
Here are the files I got:
When I execute hl sample.hl
it complains about a missing hdll :
FATAL ERROR : Failed to load library ammer_adder.hdll
nmake
is supposed to run automatically on Windows, was there another error when invoking Haxe? I also see there is a ammer_adder.hl.dll
file in the directory, does it work when you rename it to ammer_adder.hdll
?
No it doesn't work.
But I have warning when invoking haxe:
haxe -D ammer.hl.hlInclude=C:\Development\hl-1.11.0-win\include -D ammer.hl.hlLibrary=C:\Development\hl-1.11.0-win build-hl.hxml
nmake [/f,Makefile.hl.ammer]
Microsoft (R) Program Maintenance Utility Version 14.16.27030.1
Copyright (C) Microsoft Corporation. Tous droits réservés.
cl /OUT:ammer_adder.hdll /LD ammer_adder.hl.obj /DLIBHL_EXPORTS /link /LIBPATH:"C:\Development\hl-1.11.0-win" /LIBPATH:"C:/HaxeToolkit/haxe/lib/ammer/git/samples/poc/native" libhl.lib adder.lib
Compilateur d'optimisation Microsoft (R) C/C++ version 19.16.27030.1 pour x86
Copyright (C) Microsoft Corporation. Tous droits réservés.
cl : Ligne de commande warning D9002 : option '/OU' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/OT' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/O:' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Oa' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Om' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Om' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Oe' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Or' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/O_' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Oa' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Oe' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Or' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/O.' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Oh' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Ol' inconnue ignorée
cl : Ligne de commande warning D9002 : option '/Ol' inconnue ignorée
Microsoft (R) Incremental Linker Version 14.16.27030.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:ammer_adder.hl.dll
/dll
/implib:ammer_adder.hl.lib
/LIBPATH:C:\Development\hl-1.11.0-win
/LIBPATH:C:/HaxeToolkit/haxe/lib/ammer/git/samples/poc/native
libhl.lib
adder.lib
ammer_adder.hl.obj
Création de la bibliothèque ammer_adder.hl.lib et de l'objet ammer_adder.hl.exp
@Aurel300 Playing around i've found MSVC cl.exe has no /OUT
switch for defining resulting filename so it ignores blahblah.hdll and creates dll with default name. The manual says /Fe
switch suit this goal. I've tried to fix makefile produced by ammer and call nmake manually then everything worked fine.
BTW What do you think about if BuildTools could be more OOP-like? I mean smth like MSVCProcessor
, GCCProcessor
instead of multiple Ammer.config.useMSVC
checks?
@pecheny Ah, I see, thanks. I'm not sure where I got /OUT
from in the first place. As for the BuildTools
change – why not. I didn't want to overengineer these parts, but you're right that it's weird to do the useMSVC
check multiple times.
@Aurel300 glad you liked the idea. As for me it doesn't look like overengineering but most appropriate place to apply oop. Several opened issues about support different platforms/toolchains would be easier to support in this way. Also i have another idea. Maybe CMake configuration instead of several makefile formats would be easier to support. It can be good addition because it supports any composiotion of platform/os/compiler.
CMake would be nice as another alternative, but not as the only method. I know it is becoming pretty ubiquitous as a build system but I still prefer that the only thing you need for ammer
projects (apart from Haxe) really is just the most basic C compiler + make
stack possible.