Open thejustinwalsh opened 7 years ago
Similar error on windows as well:
./src/org/si/sion/sequencer/base/MMLParser.cpp(756): error C2664: 'Dynamic Dynamic::Default(const Dynamic &)': cannot convert argument 1 from 'unsigned long' to 'const Dynamic &'
./src/org/si/sion/sequencer/base/MMLParser.cpp(756): note: Reason: cannot convert from 'unsigned long' to 'const Dynamic'
./src/org/si/sion/sequencer/base/MMLParser.cpp(756): note: No constructor could take the source type, or constructor overload resolution was ambiguous
haxe -version
3.4.2 (git build master @ 890f8c7)
haxelib list
hxcpp: [3.4.64]
lime-samples: [4.0.1]
lime: 2.9.1 5.2.1 [5.3.0]
openfl-samples: 5.1.1 [6.0.0]
openfl: 3.6.1 5.1.5 [6.0.1]
It appears that the compiler will assign the type of long for signed integer literals although I am not sure under what circumstances the literal is defined as a long.
I was able to resolve the issue by adding the proper constructors to handle long
and unsigned long
// Dynamic.h
Dynamic(long inVal);
Dynamic(unsigned long inVal);
//Dynamic.cpp
Dynamic::Dynamic(long inVal)
{
mPtr = fromInt(inVal);
}
Dynamic::Dynamic(unsigned long inVal)
{
mPtr = fromInt(inVal);
}
I have this problem in Mac too:
error: conversion from 'size_t' (aka 'unsigned long') to '::Dynamic' is ambiguous
with the next code:
var num:cpp.SizeT = 10;
trace('My num is ${num}');
The PR was changed in https://github.com/HaxeFoundation/hxcpp/commit/d9c02ec114f7db00070b46a91a45ff3bfc353530
When compiling SiON for macOS (
lime build mac -debug
) I am getting the following compiler error:When compiling for iOS (
lime build ios -debug
) the compilation results in a few more warnings, and still fails to compile:Which is generated from the following source: https://github.com/thejustinwalsh/SiON/blob/master/src/org/si/sion/sequencer/base/MMLParser.hx#L476-L478
Using the definition of
INT_MIN_VALUE