On 19 June 2015 at 23:15, <highcalcula...@gmail.com> wrote:

>
> > This could be because your system PATH is not set to include the
>
>> > directory where the dll file is.
>>>>
>>>> On Windows it is possible to link directly to a DLL but this is more
>>>> normally done through a stub-library.
>>>>
>>>> So on a native build on Windows the mpir.dll is accompanied by the stub
>>>> library mpir.lib.  So an app links to the stub library which then links
>>>> to the DLL itself.  IIRC a symbol 'sym' in the DLL becomes '__imp__sym'
>>>> in the stub library so it seems to me that the mingw/GCC build system is
>>>> not producing a stub library.
>>>>
>>>
>>> That sounds right to me. The mingw build doesn't produce a .lib file
>>> (stub library). You have to create one if you want to use the dll produced
>>> by mingw.
>>>
>>> In fact, the stub library is apparently not required to use the dll with
>>> mingw, which I guess is why it doesn't create one. Internally, it uses the
>>> Microsoft linker, but I don't completely understand the precise mechanism.
>>> Bill.
>>>    Brian
>>>
>>
> Ok I have tried building stub libraries (containing only one column with
> the names "__gmp_init" etc. of the functions used in the code, using the MS
> lib tool. Now using "-lmpir" or "-lmpir-16" in the mex command should find
> the libmpir-16.dll, which, I suppose, contains the addresses (locations) of
> the various function definitions, via the stub library?
>

I guess that is the idea. Is your stub library named correctly now?


> It does not yet the job. I will try to read more mex documentation.
> Is there anything like a MinGW path variable I would be able to set?
>

Is mex a MinGW application? If not then setting a path variable in MinGW
won't do anything.

You need to set your Windows PATH enviroment variable (I think that is
where Windows looks for dll's). This has nothing to do with MinGW. Remember
to use a full Windows path, not a unix one.

If mex is a MinGW application, set PATH in MinGW. Remember to use a unix
path, not a Windows one.

> I am trying currently also to edit the mexopt.bat file which is called at
the beginning of mex execution.

> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "mpir-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mpir-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to mpir-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/mpir-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to