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]

Re: gcc, cygwin, jni headers


Hi,

Ive seen one other post on this topic but there were no replies. Maybe Ill
be more lucky.
Im trying to compile a simple dll using gcc and cygwin. Something very
similar to below used to work on dos and mingw but now Im geting loads of
errors as gcc tries to compile some headers?! Below is my make file and the
first few lines of the output. Please help. Its not that I should be using
solaris versions of the Java headers (jni_md.h and jawt_md.h) is it?
No. The windows headers should do just fine.

TIA.
El.

#### MAKEFILE ####

JAVA_HOME = C:/Progra~1/java/jdk14~1.0
Consider using a posix path to JAVA_HOME e.g. /cygdrive/c or whatever you have mounted your c drive as. Also im not sure whether those squigglies will cause you problems (???).

JAVA_HOME = /cygdrive/c/java/jdk14~1.0

CC = gcc
Also use the GNU linker (ld), as im not sure whether this would work

LD = ld

LD = gcc
RM = rm
SHELL = /bin/sh

CFLAGS = -O #-v --save-temps
CPPFLAGS =
LDFLAGS = -I$(SRC_DIR) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
RMFLAGS = -f

SRC_DIR = .

SOURCES = \
$(SRC_DIR)/jvmpi1_1.c

.PHONY: all
all: jvmpi1_1.dll

jvmpi1_1.dll: $(SOURCES)
$(CC) -D_BUILD_DLL $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@
$(SOURCES) -Wl,--kill-at

%.d: %.c
$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm $(RMFLAGS) $@'

ifneq ($(MAKECMDGOALS), clean)
ifneq ($(MAKECMDGOALS), cleanall)
include $(SOURCES:.c=.d)
endif
endif

.PHONY: clean cleanall
clean:
-$(RM) $(RMFLAGS) *.o *.d
cleanall: clean
-$(RM) $(RMFLAGS) *.exe *.dll

#### OUTPUT ####

gcc -D_BUILD_DLL -O -I. -IC:/Progra~1/java/jdk14~1.0/include -IC:/Progra~1
/jav
a/jdk14~1.0/include/win32 -shared -o jvmpi1_1.dll ./jvmpi1_1.c -Wl,--kill-at
In file included from C:/Progra~1/java/jdk14~1.0/include/jni.h:30,
from jvmpi1_1.h:8,
from ./jvmpi1_1.c:5:
C:/Progra~1/java/jdk14~1.0/include/win32/jni_md.h:19: parse error before
`jlong'
C:/Progra~1/java/jdk14~1.0/include/win32/jni_md.h:19: warning: data
definition h
as no type or storage class
In file included from jvmpi1_1.h:8,
from ./jvmpi1_1.c:5:
C:/Progra~1/java/jdk14~1.0/include/jni.h:111: parse error before `jlong'
C:/Progra~1/java/jdk14~1.0/include/jni.h:111: warning: no semicolon at end
of st
ruct or union
C:/Progra~1/java/jdk14~1.0/include/jni.h:115: parse error before `}'
C:/Progra~1/java/jdk14~1.0/include/jni.h:115: warning: data definition has
no ty
pe or storage class
C:/Progra~1/java/jdk14~1.0/include/jni.h:258: parse error before `jvalue'
....





--
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/

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


--
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]