hxcpp
hxcpp copied to clipboard
Haxe 4-rc.3 Cppia: Declaring a static function with dynamic parameter fails to compile.
Using hxcpp 4.0.19. When trying to compile
class EitherSupport {
public static function getValue(e: Dynamic): Void {
}
}
I get a compilation error on cppia
Error reading file Bad class type, line 14, char 9
Here's the generated cppia code:
CPPIB
5
0
3 new
4 main
8 getValue
1 e
5
0
8 AnnaLang
4 void
13 EitherSupport
7 Dynamic
2
D D �� K M
Am I missing something?
@hughsando This looks like it's still an issue with haxe 4.2.4 and hxcpp 4.2.1. I've narrowed it down to getting this error when passing arguments to a function. This may be isolated to just windows. I wouldn't mind tracking down the issue and creating a PR if you give me a some tips on how to track this down.
If you compile with -debug -D annotate-source
the cppia file will have more information that might help. It might also avoid the problem by using ascii out, but that would be some more information too.
I just re-read my original post. I'm sorry, this is not a compilation error. This is the error coming out of Module.fromString(cppiaCode);
and the other functions in Module
at runtime. I just tried adding the -D annotate-source
to my compilation flags and the entire problem went away. Problem solved?!!?
Sounds like there is some incompatibility in the binary format. With just debug (not annotate-source)do you still get the problem? It could either be the binary write, binary reader or maybe some unexpected character in the file. The binary and ascii version should parallel each other quite closely, so you might be able to work out what it is trying to read by comparing the two.
On Mon, Nov 29, 2021 at 11:19 AM Skyler Parr @.***> wrote:
I just re-read my original post. I'm sorry, this is not a compilation error. This is the error coming out of Module.fromString(cppiaCode); and the other functions in Module at runtime. I just tried adding the -D annotate-source to my compilation flags and the entire problem went away. Problem solved?!!?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HaxeFoundation/hxcpp/issues/837#issuecomment-981254629, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWTVRQFOKRZGN62XZBXQLUOLWMBANCNFSM4IIBVQ7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
-D annotate-source
worked regardless of the -debug
flag.
re:
The binary and ascii version should parallel each other quite closely
I'm not quite following what you mean there. Are you talking about looking at the generated cppia file? Is there a way to compile to binary vs ascii?
Yes, the debug version is Ascii (Starts with CPPIA) and the release version is binary (starts with "CPPIB") The ascii version with annotations is almost readable
On Mon, Nov 29, 2021 at 12:00 PM Skyler Parr @.***> wrote:
-D annotate-source worked regardless of the -debug flag. re: The binary and ascii version should parallel each other quite closely I'm not quite following what you mean there. Are you talking about looking at the generated cppia file? Is there a way to compile to binary vs ascii?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HaxeFoundation/hxcpp/issues/837#issuecomment-981270870, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWTVWULMC4TEYYP2AWC23UOL3F5ANCNFSM4IIBVQ7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.