connecting to a lib

Hi Everyone,

In the interest of not wanting to screw around with too many DLL's, I compiled a c++ 'win32 static library' which is called 'Host.lib'

I was wondering if anyone knows how I would connect to this file? Everything is set up with the JNI and such for when I was conecting to a DLL file... But I must need to change something now cause it doesn't work ;(

Cheers,

Crispin

[416 byte] By [crispin1a] at [2007-11-26 23:54:37]
# 1
No Ideas?
crispin1a at 2007-7-11 15:37:03 > top of Java-index,Java Essentials,Java Programming...
# 2

>> I was wondering if anyone knows how I would connect to this file?

Connect how? Do you mean you want to know how to use it within

a Java program?

>> Everything is set up with the JNI

You have all the javah headers and such? You have all the

relevant code (native methods and loadlibrary)?

>> But I must need to change something now cause it doesn't work

: )

That sentence couldnt be more vague if you said "something happened

so i have to do something", lol.

TuringPesta at 2007-7-11 15:37:03 > top of Java-index,Java Essentials,Java Programming...
# 3

Hi,

I have everything set up and working fine with the JNI and on the Java end, and on the C++ end... the only difference now is that I compiled the c++ as a static library (which produces a single lib file) instead of the usual dll + lib that I got when I compiled as a standard 'dynamic' library.

crispin1a at 2007-7-11 15:37:03 > top of Java-index,Java Essentials,Java Programming...
# 4
then I would say that that one difference was a pretty important one...
tsitha at 2007-7-11 15:37:03 > top of Java-index,Java Essentials,Java Programming...
# 5

> I was wondering if anyone knows how I would connect

> to this file? Everything is set up with the JNI and

> such for when I was conecting to a DLL file... But I

> must need to change something now cause it doesn't

> work ;(

Java works with shared libraries, nothing else.

However you might note that I seriously doubt that you could write a C app that would dynamically load a static library, so it isn't surprising that java doesn't do it either.

The whole point of shared libraries is that they can be loaded dynamically.

I don't know what you mean by "too many dlls'. You can create a single dll presuming that you have the source/libraries to do that.

jschella at 2007-7-11 15:37:03 > top of Java-index,Java Essentials,Java Programming...