0

I'm using JLirc to access my remote control in java. It uses a native method to connect to lirc through a socket. Unfortunately, the last update of JLirc was 15 years ago, so it has no support for 64 bit systems.

I therefore turned to JUDS, which should be able to give me another way to create a socket to connect to lirc.

I use what I think is standard C methods to compile the library accessed through java (libunixdomainsocket-linux-x86_64.so). I created the config file usingautoconf and the makefile using ./configure.

If I now run make, I get the following error:

/usr/bin/javah -sourcepath . -o com/etsy/net/UnixDomainSocket.h com.etsy.net.UnixDomainSocket
gcc -g -O2 -shared -fPIC -I /usr/include -I /usr/include/linux -I /usr/lib/jvm/java-7-openjdk-amd64/include -m32 -o libunixdomainsocket-linux-i386.so com/etsy/net/UnixDomainSocket.c 
In file included from /usr/include/stdio.h:74:0,
                 from /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h:39,
                 from com/etsy/net/UnixDomainSocket.h:2,
                 from com/etsy/net/UnixDomainSocket.c:6:
/usr/include/libio.h:306:3: error: unknown type name ‘size_t’
   size_t __pad5;

I read on this question that including <stddef.h> would help. However, adding the line #include <stddef.h> in the .c source file that it tries to compile doesn't help.

Any idea what I can do to fix this?

  • Find a way to compile JUDS and get my .so file
  • Find another way than JUDS to connect to a linux socket in java
  • find another way than JLirc to connect to lirc through java
Community
  • 1
  • 1
tb189
  • 1,942
  • 3
  • 22
  • 37
  • Did you add the include of `` at the top of the `.c` file? If so, try `` instead. – abligh Jan 10 '15 at 14:35
  • Since you are already using Autoconf anyway, you should have it figure out how to get `size_t` by using its [`AC_TYPE_SIZE_T`](https://www.gnu.org/software/autoconf/manual/autoconf.html#Particular-Types) macro. – 5gon12eder Jan 10 '15 at 14:45
  • You *might* be able to get away with a preprocessor macro (`-Dsize_t=int`), but if there are many other compile errors you're likely better off fixing the `autoconf` operation. – technomage Jan 12 '15 at 15:22

0 Answers0