|
From: Xavier M. <xa...@te...> - 2011-12-01 15:13:21
|
Hallo
sorry for the 3 mails.
I finally got the solution from the examples makefile...
I've got to use by linking
$(GCC) -shared -mno-cygwin -mthreads -Wl,--add-stdcall-alias -D__WIN32__
xm
Xavier Marduel wrote:
> Hi,
> I've already managed to create a java wrapper of c code on linux, and
> also on windows, but using the code on Windows fails:
>
> I've created the dll named "narecord.dll" and "narecord.lib", I've got a
> test program in java which looks usual (as in the examples)
>
> dll was created with :
> gcc.exe -shared -dll -mno-cygwin -Wl,--out-implib,narecord.lib
> -D__WIN32__ -o narecord.dll OBJ_SHARED.x86-mingw32/narecord_wrap.o
> (others .o) (other .a)
>
> but I've got the following error msg:
>
> java code:
>
> pstring_t = new pstring_t();
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
> narecordJNI.new_pstring_t()J
> at narecordJNI.new_pstring_t(Native Method)
> at pstring_t.<init>(pstring_t.java:46)
> at narecord_driver.main(narecord_driver.java:529)
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> ie the library seems to be correctly loaded (i guess) because the code
>
> public class narecord_driver {
> static
> {
> try
> {
> System.loadLibrary("narecord");
> }
> catch (UnsatisfiedLinkError e)
> {
> System.err.println("Native code library failed to load. See the
> chapter on Dynamic Linking Problems in the SWIG Java documentation for
> help.\n" + e);
> System.exit(1);
> }
> }
>
> does not throw any exception.
>
> With the dll viewer "depends.exe" (dependancy walker) I can see that my
> function is indeed inside the dll
> (well, it is named "Java_narecordJNI_new_1pstring_1t@8" but I also
> guess it is correct) so what's wrong ?
>
> Can anyone tell me what I'm doing wrong ?
>
> many thanks in advance,
>
> xm
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Swig-user mailing list
> Swi...@li...
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
|