|
From: Earnie B. <ear...@ya...> - 2003-08-18 12:50:14
|
Since this isn't MSYS specific it is better asked on the mingw-users
list. I'm redirecting there. Please remove
min...@li... from the distribution when responding.
Earnie.
Shaun Kelly wrote:
> Good Day All,
>
> I am having major problems with dll's that I am creating! I am a linux
> programmer who is trying
> to port c code to windows using mingw/msys. I am needing to create DLL's that
> both c exe's and
> Java jar's can access via the jni interface. (My priority is Java access thou.
> I must add that the code
> is working under linux using so shared libraries. )
> I am running msys-1.0.9 and mingw3.0 on winXP PC.
>
> My errors are :
> java.lang.UnsatisfiedLinkError:
> C:\msys\1.0.9\local\bin\iss\libstdj_JniEventReader2.dll: Invalid access to
> memory location
>
> What is the best way of creating DLL's unders Mingw/Msys? I am using dllwrap as
> follows :
> (I pass a library name and list of objects and a list of libraries to this
> script)
> ----------
> ....
> AR_EXT=a
> DLL_EXT=dll
> DEF_EXT=def
> TARGET=${ARG1}.${DLL_EXT}
> ARCH=${ARG1}.${AR_EXT}
> ARCHIVE=${ISSLIB}/${ARCH}
> DLLNAME=${ARG1}.${DLL_EXT}
> DEFNAME=${ARG1}.${DEF_EXT}
> NEWDEF=new_${DEFNAME}
>
> dllwrap --export-all \
> --enable-stdcall-fixup \
> --add-stdcall-alias \
> --output-def ${DEFNAME}2 \
> -L${ISSLIB} \
> -o ${TARGET} $* -lm
>
> impdef ${DLLNAME} > ${NEWDEF}
>
> dllwrap --export-all \
> --enable-stdcall-fixup \
> --add-stdcall-alias \
> --def ${NEWDEF} \
> --output-def ${DEFNAME} \
> --implib ${ARCH} \
> -L${ISSLIB} \
> -o ${TARGET} $*
> ...
> ---------
> I have put ' __declspec(dllexport)' infront of every function that I export. (I
> actually don't know when to use
> dllimport, and wether or not to use it for global variables that I want to
> access from outside?)
>
> If I don't use the impdef on the dll I create and use the generated .def file to
> create the final dll I cannot link
> against the dll.
>
> Can you help ?
>
> Regards
> Shaun.
> --
> Shaun Kelly
> ISS International Limited, Technical Division, Software Engineering
> P O Box 12063, DIE BOORD 7613, South Africa
> Tel: +27 (0)21 809-2096 Fax: +27 (0)21 809-2061
> Email: sh...@is... Web Page: http://www.issi.co.za
>
> Confidentiality Warning
> ____________________________________________________________________
>
> This e-mail message contains confidential information which is
> intended for the use of the person to whom it is addressed. If you
> received it in error, please notify the sender and delete the
> material from any computer. Any disclosure, re-transmission,
> dissemination or any other use of this information is strictly
> prohibited.
> ____________________________________________________________________
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Mingw-msys mailing list
> Min...@li...
> https://lists.sourceforge.net/lists/listinfo/mingw-msys
>
|