-
Notifications
You must be signed in to change notification settings - Fork 83
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
The value for annotation attribute Array.value must be a constant #354
Comments
Hi @igler , Thanks for your report! Using the freshly-released version 0.11 of JNAerator on the following snippet, things appear to work: const int LEN1 = 10;
#define LEN2 20
struct S {
int a[LEN1];
int b[LEN2];
}; Cheers |
Hi, I use the following maven plugins: com.nativelibs4java bridj 0.6.1 com.nativelibs4java maven-jnaerator-plugin 0.10 maven-pluginWho is uploading recent version of 'maven-jnaerator-plugin' to maven repository? The C-code that causes the warning/error looks like: ... The generated Java code is: |
Hi @igler , Thanks for these details! Oh, and JNAerator 0.11 & BridJ 0.6.2 have just been synced to Maven Central (they still exhibit the same issue but bring along tons of other fixes, please give them a try :-)). Cheers |
Thanx for the info. Using them henceforth. ... but the annotation-error persists. A soon fix would be nice :-) |
As a temporary workaround, you can try defining that item as a constant with -DTIP_ITEMID_LENGTH=31 |
Tried 'mvn -DTIP_ITEMID_LENGTH=31 com.nativelibs4java:maven-jnaerator-plugin:generate' but the generated code is not different. |
Hi @igler, This argument needs to be passed to JNAerator using its configuration file (Maven's Cheers |
Well, added it to config.jnaerator but then I get additional errors. The callback functions I added to my C-header are not generated any more. The config: |
Hi @igler , Sorry for the long delay, this should be fixed in the latest 0.12-SNAPSHOT. |
When generating Java code through 'mvn com.nativelibs4java:maven-jnaerator-plugin:generate' the generated Java-code looks like this:
@array({(int)de.test.MyLibrary.tipmon_sizes.TIP_GDA_DATA_LENGTH.value()})
Java compiler complains with the error:
"The value for annotation attribute Array.value must be a constant"
How can I solve the issue? The Java version I use is jdk1.7.0_09
The text was updated successfully, but these errors were encountered: