Skip to content
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

resolving anonymous struct in C library #501

Closed
seem-less opened this issue Jun 15, 2021 · 11 comments
Closed

resolving anonymous struct in C library #501

seem-less opened this issue Jun 15, 2021 · 11 comments
Labels

Comments

@seem-less
Copy link

I am trying to build a javacpp-preset for the Leap Motion controller in Windows. I am getting a compiler issue for the following snippet of code found in the LeapC.h header file. Header and library files can be found by downloading the Windows SDK here .

Snippet from C Header file:

typedef struct _LEAP_DISTORTION_MATRIX {
  /** A point in the distortion grid. @since 3.0.0 */
  struct {
    /** The x-pixel coordinate. @since 3.0.0 */
    float x;
    /** The y-pixel coordinate. @since 3.0.0 */
    float y;
  }
  /** A grid of 2D points. @since 3.0.0 */
  matrix[LEAP_DISTORTION_MATRIX_N][LEAP_DISTORTION_MATRIX_N];
} LEAP_DISTORTION_MATRIX;

this is the current state of the presets/leapmotion.java file:

package org.bytedeco.leapmotion.presets;

import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
import org.bytedeco.javacpp.tools.*;

@Properties(
    value = {
        @Platform(
                value = "windows",
                include = "LeapC.h",
                link = "LeapC")
    },
    target = "org.bytedeco.leapmotion",
    global = "org.bytedeco.leapmotion.global.leapmotion"
)
public class leapmotion implements InfoMapper {
    static { Loader.checkVersion("org.bytedeco", "leapmotion"); }

    public void map(InfoMap infoMap) {

        infoMap.put(new Info("LEAP_EXPORT","LEAP_CALL","LEAP_STATIC_ASSERT","static_assert").cppTypes().annotations())
                
                .put(new Info("_LEAP_CONNECTION").pointerTypes("LEAP_CONNECTION"))
                .put(new Info("LEAP_CONNECTION").valueTypes("LEAP_CONNECTION").pointerTypes("@Cast(\"LEAP_CONNECTION*\") _LEAP_CONNECTION", "@ByPtrPtr LEAP_CONNECTION"))
                
                .put(new Info("_LEAP_DEVICE").pointerTypes("LEAP_DEVICE"))
                .put(new Info("LEAP_DEVICE").valueTypes("LEAP_DEVICE").pointerTypes("@Cast(\"LEAP_DEVICE*\") _LEAP_DEVICE", "@ByPtrPtr LEAP_DEVICE"))

                .put(new Info("_LEAP_CLOCK_REBASER").pointerTypes("LEAP_CLOCK_REBASER"))
                .put(new Info("LEAP_CLOCK_REBASER").valueTypes("LEAP_CLOCK_REBASER").pointerTypes("@Cast(\"LEAP_CLOCK_REBASER*\") _LEAP_CLOCK_REBASER", "@ByPtrPtr LEAP_CLOCK_REBASER"))

                .put(new Info("_LEAP_RECORDING").pointerTypes("LEAP_RECORDING"))
                .put(new Info("LEAP_RECORDING").valueTypes("LEAP_RECORDING").pointerTypes("@Cast(\"LEAP_RECORDING*\") _LEAP_RECORDING", "@ByPtrPtr LEAP_RECORDING"))

                .put(new Info("_LEAP_CALIBRATION").pointerTypes("LEAP_CALIBRATION"))
                .put(new Info("LEAP_CALIBRATION").valueTypes("LEAP_CALIBRATION").pointerTypes("@Cast(\"LEAP_CALIBRATION*\") _LEAP_CALIBRATION", "@ByPtrPtr LEAP_CALIBRATION"));
         
    }
}

The compiler error:

[INFO] --- javacpp:1.5.6-SNAPSHOT:build (javacpp-compiler) @ leapmotion ---
[INFO] Detected platform "windows-x86_64"
[INFO] Building platform "windows-x86_64"
[INFO] Generating C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp
[INFO] Generating C:\msys64\home\user\javacpp-presets\leapmotion\target\native\META-INF\native-image\windows-x86_64\jnijavacpp\jni-config.json
[INFO] Generating C:\msys64\home\user\javacpp-presets\leapmotion\target\native\META-INF\native-image\windows-x86_64\jnijavacpp\reflect-config.json
[INFO] Generating C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp
[INFO] Generating C:\msys64\home\user\javacpp-presets\leapmotion\target\native\META-INF\native-image\windows-x86_64\jnileapmotion\jni-config.json
[INFO] Generating C:\msys64\home\user\javacpp-presets\leapmotion\target\native\META-INF\native-image\windows-x86_64\jnileapmotion\reflect-config.json
[INFO] Compiling C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.dll
[INFO] cl /IC:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include "/IC:\Program Files\Java\jdk-11.0.10\include\win32" "/IC:\Program Files\Java\jdk-11.0.10\include" C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp /Oi /O2 /EHsc /Gy /GL /MD /LD /W3 /link /OUT:jnileapmotion.dll /LIBPATH:C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\lib LeapC.lib psapi.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30037 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

jnileapmotion.cpp
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(312): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(313): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(333): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(400): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(402): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(470): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(674): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(674): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(674): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(674): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(674): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(674): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(677): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(677): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(677): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(677): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(677): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(677): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(708): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(708): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(708): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(708): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(708): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(708): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(723): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(723): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(723): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(723): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(723): error C2618: illegal member designator in offsetof
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(723): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(909): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(922): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(934): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(946): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(989): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(1002): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(1014): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(1026): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(5355): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(5368): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(5380): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(5392): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(8981): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(8994): error C2039: 'x': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(9006): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnileapmotion.cpp(9018): error C2039: 'y': is not a member of '_LEAP_DISTORTION_MATRIX'
C:\msys64\home\user\javacpp-presets\leapmotion\cppbuild\windows-x86_64\include\LeapC.h(993): note: see declaration of '_LEAP_DISTORTION_MATRIX'
jnijavacpp.cpp
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(433): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(598): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(599): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(619): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(686): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(688): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1112): warning C4244: 'argument': conversion from 'jlong' to 'jint', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1113): warning C4244: 'argument': conversion from 'jlong' to 'jint', possible loss of data
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1205): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1313): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1391): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1450): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1468): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\msys64\home\user\javacpp-presets\leapmotion\target\native\org\bytedeco\leapmotion\windows-x86_64\jnijavacpp.cpp(1490): warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  34.328 s
[INFO] Finished at: 2021-06-15T12:35:07+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.5.6-SNAPSHOT:build (javacpp-compiler) on project leapmotion: Execution javacpp-compiler of goal org.bytedeco:javacpp:1.5.6-SNAPSHOT:build failed: Process exited with an error: 2 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.bytedeco:javacpp:1.5.6-SNAPSHOT:build (javacpp-compiler) on project leapmotion: Execution javacpp-compiler of goal org.bytedeco:javacpp:1.5.6-SNAPSHOT:build failed: Process exited with an error: 2
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution javacpp-compiler of goal org.bytedeco:javacpp:1.5.6-SNAPSHOT:build failed: Process exited with an error: 2
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: Process exited with an error: 2
    at org.bytedeco.javacpp.tools.Builder.generateAndCompile (Builder.java:628)
    at org.bytedeco.javacpp.tools.Builder.build (Builder.java:1175)
    at org.bytedeco.javacpp.tools.BuildMojo.execute (BuildMojo.java:417)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

How do I handle this struct that has a nested struct in it? (I believe it is an anonymous struct too)

Thanks!

@saudet saudet added the bug label Jun 16, 2021
saudet added a commit that referenced this issue Jun 16, 2021
@saudet
Copy link
Member

saudet commented Jun 16, 2021

Fixed in commit 04da8eb. Thank you for reporting!
Please give it a try with the snapshots: http://bytedeco.org/builds/

@seem-less
Copy link
Author

I pulled from bytedeco/javacpp and successfully re-installed using mvn clean install -Djavacpp.platform=windows-x86_64. I then went back into the javacpp-presets directory and successfully ran mvn clean install -Djavacpp.platform=windows-x86_64 --projects .. I then got the same compiler error as described in the original post after running mvn clean install --projects .,leapmotion.

All the code for creating this preset is in this PR for javacpp-presets. Am I doing something wrong in the preset file or is there still a bug?

@saudet
Copy link
Member

saudet commented Jun 21, 2021

You're probably getting another error. Please attach the whole log here.

@seem-less
Copy link
Author

Here is the full log
leapmotionLog.txt

@saudet
Copy link
Member

saudet commented Jun 21, 2021

You're not using the most recent version. If you have problems installing this locally, please use the snapshots instead: http://bytedeco.org/builds/

@seem-less
Copy link
Author

I believe I am using the snapshots as seen in the PR on line 9 of the pom.xml

@saudet
Copy link
Member

saudet commented Jun 21, 2021

Make sure to run with mvn -U ... and if that doesn't work either, remove your local ~/.m2 cache, and try again. BTW, I'm not here to teach you how to use Maven! If you do not understand all this, please go read tutorials about it.

@seem-less
Copy link
Author

Make sure to run with mvn -U ... and if that doesn't work either, remove your local ~/.m2 cache, and try again. BTW, I'm not here to teach you how to use Maven! If you do not understand all this, please go read tutorials about it.

ok I used the -U flag to update snapshots and that didn't work. I deleted the ~/.m2 cache and tried again and that didn't work. I also used mvn dependency:purge-local-repository on both the javacpp and javacpp-presets folders, successfully re-built javacpp-1.5.6-SNAPSHOT.jar and javacpp-1.5.6-SNAPSHOT-windows-x86_64.jar and then tried installing leapmotion again by running mvn -U clean install --projects .,leapmotion and I am left with the same compiler error.

@saudet
Copy link
Member

saudet commented Jun 23, 2021

Well, what you have provided me with works perfectly fine for me on my end now. I cannot fix what isn't broken! Please provide me with maybe something else that doesn't work for you, and if it also doesn't work for me, then I'll be able to do something about it.

@saudet
Copy link
Member

saudet commented Jun 23, 2021

BTW, I don't see where the _LEAP_DISTORTION_MATRIX.java file gets generated. If you do not need it, please remove it.

@saudet
Copy link
Member

saudet commented Aug 3, 2021

Fix included in JavaCPP 1.5.6! Thanks for reporting, and I'm assuming it's also now working for you, but please let me know if you still have problems.

@saudet saudet closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants