Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3C082E02.5030900@neuron.com> Date: Fri, 30 Nov 2001 20:10:26 -0500 From: Stewart Allen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120 X-Accept-Language: en-us MIME-Version: 1.0 To: cygwin AT sources DOT redhat DOT com Subject: trying to compile jni lib under win2k Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 AT 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/