Error: float_of_string - windows target


#1

Hi all,
Still porting my as3 game to haxe, now the game runs fine when targetting flash and I’m trying to get it to compile to windows/c++

Had errors that turned out to be caused by some as3hx.Compat.parseInt() remaining from the conversion process, fixed them all, and now HaxeDevelop’s output is

Running process: C:\Program Files (x86)\HaxeDevelop\Tools\fdbuild\fdbuild.exe “D:\Documents\GitHub\SuperAgency\dev\SuperAgency\SuperAgency.hxproj” -ipc 82d81f02-6d26-4932-bc64-49a8a4153860 -version “3.4.4” -compiler “C:\HaxeToolkit\haxe” -library “C:\Program Files (x86)\HaxeDevelop\Library” -target "windows"
Building SuperAgency
Running Pre-Build Command Line…
cmd: “C:\HaxeToolkit\haxe/haxelib” run lime build “project.xml” windows -debug -Dfdb
Error: float_of_string
Build halted with errors.
Done(1)

Is there any way for me to know what is causing this error ? Any hint would be welcome :slight_smile:


#2

Tried using command line with -v for verbose output but it’s not helpful either

(…)
Running command: BUILD

  • Copying library file: C:/HaxeToolkit/haxe/lib/lime/6,2,0/ndll/Windows/lime.nd
    ll -> bin/windows/bin/lime.ndll
  • Running command: haxe bin/windows/haxe/debug.hxml -D no_console
    Error: float_of_string

#3

Do you have any assets set to embed="true" in your project.xml? This might occur if the build process is running out of memory, embedded assets have size limits currently. Another possibility is if you use @:bitmap or other inline embedded classes


#4

I have some embeds, but it is less than 5MB. Tried with embed=false but I still get the same error.

I don’t have any @:bitmap or @:meta(Embed(…)) left either… tried on my laptop too just in case :slight_smile:
I’m almost sure that I had this error at some point in the very first days I learned haxe, messing with the demos and testing stuff, but can’t remember what it was related to…

There is no way to have more details from the compiler in such a case ?


#5

Not sure if any of these would help

Perhaps it is an error occurring in a macro, or does it occur on all platforms, or just some? Can you revert back to before this started happening?


#6

Thanks singmajesty, could be useful

I’ve been focusing on getting the game to work on flash target first, now that it does I’m focusing on windows target so it’s not like “it used to work then I changed something and it doesn’t anymore”. If I set the target to flash again it all works.

I fixed errors that were related to using as3hx.Compat.parseInt() (not sure if that’s expected but using this will result in compilation errors on windows target), and now I have this “float_of_string” one.

I’m currently hunting it down by importing stuff from my game in a separate empty project : I will find the issue and come back here to tell what it was, hopefully that won’t take too long :smile:


#7

Perhaps you could try Neko or HTML5? It might help us get closer to finding the cause


#8

Oh good idea, can’t try that at the moment as I broke some parts while bug hunting ^^ pretty sure I tried html5 out of curiosity and it did compile although it didn’t display anything, but I don’t think I tried Neko.

I just found out at least one of the code lines that trigger the “float_of_string” error :

min = -as3hx.Compat.FLOAT_MAX;

I use this quite a lot in my stat system (the game is kind of a tactical RPG) and anytime I need a min Float value to start with. Maybe I should use Math.NEGATIVE_INFINITY instead ? Or something else ?


#9

Perhaps the float max is platform specific, or is the result larger than the float max? Yeah, negative might work for bounds or greater than checks, though I would not add or subtract it


#10

It seems platform specific yes, that’s what the documentation hint says on as3hx.Compat.FLOAT_MAX (and others MAX/MIN). INFINITY sounds special yeah so I’d prefer to avoid it as the stats min/max can be modified in many ways.

For now just doing this fixed the issue :

min = as3hx.Compat.FLOAT_MAX * -1;

No more “float_of_string” error, instead I have new errors : progress ! :smile:
Those are the same I had before removing all as3hx.Compat.parseInt()

C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:617: characters 19-58 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_device_model
C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:648: characters 20-60 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_device_vendor
C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:745: characters 22-63 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_platform_label
C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:809: characters 23-66 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_platform_version
Build failure
Build halted with errors.

I get the exact same output when compiling to Neko, compiling to html5 works although it only shows a black screen.

So far all my issues where somehow related to as3hx.Compat.something so I’ll double check that first !

Thanks for your help


#11

A small summary, for me and anyone who would run into this :slight_smile:

When targetting windows (probably also mac/linux ?)

-as3hx.Compat.FLOAT_MAX

anywhere in your code will cause a “float_of_string” error

as3hx.Compat.parseInt()

and/or

as3hx.Compat.parseFloat()

anywhere in your code will cause these errors :

C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:617: characters 19-58 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_device_model
C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:648: characters 20-60 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_device_vendor
C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:745: characters 22-63 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_platform_label
C:/HaxeToolkit/haxe/lib/lime/6,2,0/lime/system/System.hx:809: characters 23-66 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_platform_version

And finally any reference to as3hx.Compat will result in a “constant too big” error in the second part of the compilation process.

Now the compilation seems to hang on src/–resources–.cpp :smile: (with underscores instead of --)

EDIT : it doesn’t hang, it just takes a long time :wink: