This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

trying to compile jni lib under win2k


I'm trying to compile a small jni lib under win2k, but I'm getting a LOT of 
errors like this:

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

gcc  -c -DBUILDING_DLL=1 -D_DLL=1  -I /usr/include -I. 
-Ic:/java/1.3-sun/include -Ic:/java/1.3-sun/include/win32 -g -Wall -O2  -o 
jcomm.o jcomm.c
In file included from c:/java/1.3-sun/include/jni.h:30,
                  from jcomm_DriverGenUnix_Serial.h:10,
                  from jcomm.c:19:
c:/java/1.3-sun/include/win32/jni_md.h:19: parse error before `jlong'
c:/java/1.3-sun/include/win32/jni_md.h:19: warning: type defaults to `int' in 
declaration of `jlong'
c:/java/1.3-sun/include/win32/jni_md.h:19: warning: data definition has no 
type or storage class
In file included from jcomm_DriverGenUnix_Serial.h:10,
                  from jcomm.c:19:
c:/java/1.3-sun/include/jni.h:111: parse error before `jlong'
c:/java/1.3-sun/include/jni.h:111: warning: no semicolon at end of struct or union
c:/java/1.3-sun/include/jni.h:115: parse error before `}'
c:/java/1.3-sun/include/jni.h:115: warning: type defaults to `int' in 
declaration of `jvalue'
c:/java/1.3-sun/include/jni.h:115: warning: data definition has no type or 
storage class
c:/java/1.3-sun/include/jni.h:258: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:273: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:280: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:287: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:294: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:301: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:308: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:310: warning: no semicolon at end of struct or union
c:/java/1.3-sun/include/jni.h:312: warning: type defaults to `int' in 
declaration of `CallLongMethodV'
c:/java/1.3-sun/include/jni.h:312: warning: `__stdcall__' attribute directive 
ignored
c:/java/1.3-sun/include/jni.h:313: warning: type defaults to `int' in 
declaration of `jlong'
c:/java/1.3-sun/include/jni.h:313: `jlong' declared as function returning a 
function
c:/java/1.3-sun/include/jni.h:313: `jlong' redeclared as different kind of symbol
c:/java/1.3-sun/include/win32/jni_md.h:19: previous declaration of `jlong'
c:/java/1.3-sun/include/jni.h:313: warning: data definition has no type or 
storage class
c:/java/1.3-sun/include/jni.h:314: warning: type defaults to `int' in 
declaration of `CallLongMethodA'
c:/java/1.3-sun/include/jni.h:314: warning: `__stdcall__' attribute directive 
ignored
c:/java/1.3-sun/include/jni.h:315: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:315: warning: type defaults to `int' in 
declaration of `jlong'
c:/java/1.3-sun/include/jni.h:315: `jlong' declared as function returning a 
function
c:/java/1.3-sun/include/jni.h:315: warning: data definition has no type or 
storage class
c:/java/1.3-sun/include/jni.h:322: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:329: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:336: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:345: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:354: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:363: parse error before `jvalue'
c:/java/1.3-sun/include/jni.h:372: parse error before `jvalue'

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

and it goes on for a few hundred more lines. I'm using a makefile I found in 
archives of this list:

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

CC = gcc
CXX = c++

DEBUG = -g -Wall -O2
CXXFLAGS = $(DEBUG)
CFLAGS = $(DEBUG)
CPPFLAGS = -I /usr/include -I. -I$(JDK_ROOT)/include -I$(JDK_ROOT)/include/win32

JDK_ROOT = c:/java/1.3-sun

AS = as
DLLTOOL = dlltool
DLLWRAP = dllwrap

DLL_NAME = jcomm.dll
DLL_EXP_DEF = jcomm.def

all: $(DLL_NAME)

DLL_CFLAGS = -DBUILDING_DLL=1 -D_DLL=1
#DLL_LDFLAGS = -Wl,-e,__cygwin_noncygwin_dll_entry@12 -s
DLL_LDFLAGS = -Wl

# any extra libraries that your DLL may depend on.
DLL_LDLIBS = /usr/lib/libexpect526.a /usr/lib/libtcl80.a

DLL_SRCS  = jcomm.c
DLL_OBJS  = $(DLL_SRCS:.cc=.o)
DLL_OBJS := $(DLL_OBJS:.c=.o)

DLLWRAP_FLAGS = --output-def $(DLL_EXP_DEF) \
         --add-stdcall-alias \
         --driver-name $(CC) \
         $(IMAGE_BASE)

$(DLL_NAME): $(DLL_OBJS)
         $(DLLWRAP) $(DLLWRAP_FLAGS) -shared -o $(DLL_NAME) \
             $(DLL_OBJS) $(DLL_LDFLAGS) $(DLL_LDLIBS)

.cc.o:
         $(CXX) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
.c.o:
         $(CC) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ $<

# Note that we omit the $(DLL_CFLAGS) for client programs.
usedll.o: %o: %c
         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<

clean:
         -rm -f $(OBJS) $(DLL_OBJS) $(DLL_NAME) $(DLL_EXP_LIB) $(DLL_EXP_DEF) 
$(TESTPROGS)

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

FWIW, It builds cleanly under RH Linux 7.2 and Mac OS X...
Any help would be greatly appreciated.

regards,

stewart



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]