-
Notifications
You must be signed in to change notification settings - Fork 960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"JavaMathBigDecimal_initWithLong_(self, val)" declaration not available in "BigDecimal.h" causing compilation error #2323
Comments
Basically this method |
You need to update the function name to The issue is that since j2objc defines a Java If changing this function name in your project is difficult, it should be easy to |
@tomball thanks for the clarifications. Basically, we have class defined in java |
It may be a translator issue. In Java, how does your class invoke the BigNumber(long) constructor? The NumberMethodRewriter checks method declaration and class instance creation (constructor invocation) calls, but I can imagine that code making super method and constructor invocations wouldn't work. If you can, please reply with the Java method snippet(s) that have the incorrect function call in their ObjC translation(s). Feel free to rename any proprietary names, as it's just the specific BigNumber constructor call(s) that need to be turned into regression tests. |
yes, we are calling super, below is the snippet public class BigNumber extends BigDecimal implements Comparable<BigDecimal> {
....
...
public BigNumber(long val) {
super(val);
}
public BigNumber(long val, MathContext mc) {
super(val, mc);
}
} And translator is converting it to below snippet. void XYZBigNumber_initWithLongLong_(XYZBigNumber *self, jlong val) {
JavaMathBigDecimal_initWithLong_(self, val); // Causes error: call to undeclared function 'JavaMathBigDecimal_initWithLong_
}
XYZBigNumber *new_XYZBigNumber_initWithLongLong_(jlong val) {
J2OBJC_NEW_IMPL(XYZBigNumber, initWithLongLong_, val)
}
XYZBigNumber *create_XYZBigNumber_initWithLongLong_(jlong val) {
J2OBJC_CREATE_IMPL(XYZBigNumber, initWithLongLong_, val)
}
void XYZBigNumber_initWithLong_withJavaMathMathContext_(XYZBigNumber *self, jlong val, JavaMathMathContext *mc) {
JavaMathBigDecimal_initWithLong_withJavaMathMathContext_(self, val, mc);
} |
…er subclasses. PiperOrigin-RevId: 633996893
…er subclasses. PiperOrigin-RevId: 633996893
…er subclasses. PiperOrigin-RevId: 634115851
Fixed, thanks for the bug report. |
Hi, we are using j2objc tag
3.0.0
and able to transpile our's project using it. But the generated code fails with below error asJavaMathBigDecimal_initWithLong_(self, val)
method declaration is not available inj2objc/dist/include/java/math/BigDecimal.h
. However with past versions, we saw that method declaration was available inBigDecimal.h
.We are passing
OTHER_CFLAGS
=-Wno-error=implicit-function-declaration
as a workaround for now. But please let us know if it can be fixed.The text was updated successfully, but these errors were encountered: