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

[2.2.5.13] JAVA=1 Compile error #641

Closed
kevinlab-kskim opened this issue Aug 27, 2024 · 2 comments
Closed

[2.2.5.13] JAVA=1 Compile error #641

kevinlab-kskim opened this issue Aug 27, 2024 · 2 comments
Assignees

Comments

@kevinlab-kskim
Copy link

iotivity-lite version : 2.2.5.13

  1. compile option
    cd /iotivity-lite/port/linux
    make IPV4=1 DEBUG=1 TCP=1 CLOUD=1 JAVA=1 SECURE=0

  2. error message
    swig -java -package org.iotivity -outdir iotivity-lite-java/src/org/iotivity/ -DOC_CLIENT -DOC_SERVER -DOC_CLOUD -DOC_IDD_API -DOC_PKI -DOC_TCP -D__linux__ -I../ -I../include -I../port -I../util/ -I../deps/tinycbor/src/ -I../security -I../cloud -I../port/linux -o iotivity-lite-java/jni/oc_api_wrap.c swig_interfaces/oc_api.i
    ../include/oc_uuid.h:122: Error: Syntax error - possibly a missing semicolon.
    make[1]: *** [Makefile:159: oc_api.i] Error 1
    make[1]: Leaving directory '/root/iotivity-lite/swig'
    make: *** [Makefile:711: swig] Error 2

  3. OS : Rocky Linux release 8.10 (Green Obsidian)

  4. JAVA version :
    java -version
    openjdk version "1.8.0_422"

  5. git information
    git describe --tags --exact-match
    2.2.5.13

  6. swig version
    SWIG Version 3.0.12
    Compiled with g++ [x86_64-redhat-linux-gnu]
    Configured options: +pcre

@Danielius1922 Danielius1922 self-assigned this Sep 16, 2024
@Danielius1922
Copy link
Member

This seems to be an issue with the swig3 preprocessor, when I add

#define OC_NONNULL(...)

to an .i file and include a .h file which uses the macro. This works fine:

int oc_str_to_uuid_v1(const char *str, size_t str_len, oc_uuid_t *uuid)
  OC_NONNULL(1);

but this does not

void oc_gen_uuid(oc_uuid_t *uuid) OC_NONNULL();

So the swig3 preprocessor doesn't seem to match the non-parametrized define version, which is a bug I think.

@kevinlab-kskim is update to swig4 not an option?

@Danielius1922
Copy link
Member

Last Swig3 release was Jan 2017, so that's more than 7 years old. I think we can declare we only support swig4 and later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants