help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mexFunction in a .lib file


From: Michael Goffioul
Subject: Re: mexFunction in a .lib file
Date: Fri, 22 Feb 2013 14:36:30 -0500

On Fri, Feb 22, 2013 at 2:20 PM, svla299 <address@hidden> wrote:
I have used the dumbin command with the .dll in order to create the .def file
- this one contained just a mexFunction. Then I have used the lib command to
create the .lib file
Here is what I have got:
<http://octave.1599824.n4.nabble.com/file/n4650172/input_output.bmp>

Again, it would help if you could provide a complete and clear description of what you're trying to do. Here, I'll try to guess what's happening from your description and your screenshot:
- you have a DLL, let's call it mexDDGrab.dll (just a wild guess)
- you created a .def file with dumpbin, then mexDDGrab.lib with MSVC linker tool
- the DLL only exports a single symbol, "mexFunction"
- you wrote a MEX file, mexDDGrab.cpp, though I'm not sure what it does; first guess is that it's a MEX interface on top of a MEX interface...???
- you're trying to compile your own MEX file and link it against the library you created before

From the filename point of view, this cannot work: when you compile a MEX file, MSVC linker will also generate a .lib import file with the same name (if the output filename is FILE.mex, then it'll generate also FILE.lib). This is because, the MEX file exports the symbol "mexFunction", and the MSVC linker always generates an import lib when linking an executable (EXE or DLL) that exports symbols. So in your case, it'll try to generate mexDDGrab.lib, but you're also linking against a file with the same name, and that's why it fails.

You can easily work around the problem by using different filenames. For instance, when creating the .def and .lib files in step 2 above, use another name, like mexDDGrab_ext. Then when linking your own MEX file, use -lmexDDGrab_ext.

But to be honest, I'm confused by what you're trying to do. If you have a mexDDGrab.dll that exports a symbol "mexFunction", it means it is *already* a MEX file. Why are you trying to link it against another MEX file? Is it possible you're trying to make a Matlab-compiled MEX file to work with octave, but you don't have the source of the original MEX file?

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]