Hi!
Thank you for fast response.
The reason I ask regarding the gcc and gpc version is that GCC 2.9.5 and GPC didn't do the linking well on my machine.
When I linked the library with gcc compiler complained that for instance "atan(rts.o)" symbol is not resolved although I don't use atan at all.
I suppose that something is wrong with my installation of gcc or gpc, although gpc alone works well for more than half a year already without any changes.
I work on HP superdome - hppa2.0w-hp-hpux11.00
The built of gcc-core which comes with GPC (gcc-2.95.2) doesn't work good, and I assume the same regarding the full distribution, although I hadn't try it.
On the contrary gcc-3.2.1 builds clean so I suppose that gpc based on gcc-3.2.1 should perform better - I'll try it tommorow.
I've also some question regarding the preferable way to desing of my JNI vs GPC interface.
I'm planning to create Request classes and for each class corresponding structure in Pascal.
The only thing JNI will do is just decomposition of the class up to the primitives (I'm lucky using int and boolean only) and using corresponding Pascal routines to construct the structure.
Then the request will be processed by Pascal and then the opposite process will be done to the response structure.
Is there any better way to do it?
Maybe some tricking of C structure may be converted to GPC record without problems and vice versa?
Sincerely,
Nick
-----Original Message----- From: Markus Gerwinski markus@gerwinski.de To: nick ioffe_nick@mail.ru Date: Wed, 23 Jul 2003 11:48:28 +0200 Subject: Re: Shared libraries using GPC and JNI
nick wrote:
Hi!
I'm trying to use some old Pascal modules in Java through JNI.
- Is there any way of using Pascal directly or should I use it through C?
AFAIK javah always generates C headers, so you won't be able to connect Pascal functions to the JNI without an intermediate C layer.
- How should I create the mixed shared library (i.e. library containing C and Pascal objects)
Just statically build them together. (See attached example -- You'll have to edit the "makethis" file and change the paths in there, since they refer to my own directory structure.)
- What version of GPC and GCC is it prefferable to use?
Can't give you an exact recommendation, but I don't know of any problems when using the most recent version. However, it worked well, too, with GCC 2.9.5 and some GPC version back from 2001.
Best,
Markus
ATTACHMENT: application/x-gunzip ("jnidemo.tar.gz")
Nick ________________________________________ @Mail.Ru: ц▒ц²ц┴ц▀ 10ц╜ц┌, ц▓ц│ц ц█ц┘ц▓ ц░ц┴ц⌠ц≤ц█ц│ 10ц╜ц┌ http://www.mail.ru/ ________________________________________