Bug 1468 - libsigrok fails to compile with SWIG 4.xx
Summary: libsigrok fails to compile with SWIG 4.xx
Status: RESOLVED DUPLICATE of bug 1527
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Bindings: Java (show other bugs)
Version: 0.5.2
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-28 20:59 CET by Anatol
Modified: 2020-04-05 15:07 CEST (History)
3 users (show)



Attachments
Patch for classes.i (827 bytes, patch)
2020-01-06 19:18 CET, Dennis Ryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anatol 2019-12-28 20:59:47 CET
I am trying to compile libsigrok at Arch Linux that has SWIG 4.0.1 and it fails:

  GEN      bindings/ruby/classes_wrap.cpp
  CCLD     src/libdrivers.o
  GEN      src/libdrivers.lo
  CCLD     libsigrok.la
copying selected object files to avoid basename conflicts...
ar: `u' modifier ignored since `D' is the default (see `U')
  GEN      bindings/java/sigrok-core.jar
bindings/java/org/sigrok/core/classes/Driver.java:67: error: cannot find symbol
      tempoptions.set(entry.getKey(), entry.getValue());
                 ^
  symbol:   method set(ConfigKey,Variant)
  location: variable tempoptions of type ConfigMap
1 error
make[1]: *** [Makefile:5314: bindings/java/sigrok-core.jar] Error 1



It looks like SWIG has changed the way it generates java bindings.
Comment 1 Dennis Ryan 2020-01-06 19:18:06 CET
Created attachment 580 [details]
Patch for classes.i

Here is a patch for classes.i which will generate a compilable Driver.java
Comment 2 Anatol 2020-01-10 17:05:14 CET
Dennis, I confirm this patch fixes the Java binding issue.
Comment 3 Uwe Hermann 2020-04-05 15:07:05 CEST
Oops, this was re-reported (by me) as well in #1527, and fixed there in the mean time. Closing this as duplicate.

The fix by Dennis is indeed correct, however we also want to keep compatibility with SWIG 3.x, which is accomplished in the fix for #1527.

Please report back in case the current git HEAD status still has issues. Thanks!

*** This bug has been marked as a duplicate of bug 1527 ***