From: Ralf on
Hello all,

I am trying to compile a MEX-file, which uses an external library
function. The library is available as "tcdlls.lib".

But performing the compilation I get the following error. I have tried
also copying the .lib file to the working directory, but this did not
help. The library-file is correctly spelled. Using Visual Studio or
LCC-compiler did not make any difference. What is going wrong?

Thank you very much,
Ralf

>> mex timestwo.c -ltcdlls.lib -L"D:\Eigene Dateien\LibPath\"

Warning: MEX could not find the library "tcdlls.lib"
specified with -l option on the path specified
with the -L option.
Bibliothek ".......\templib.x" und Objekt ".......\templib.exp"
werden erstellt.
timestwo.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol (unresolved external symbol) "_tc_init_root" in Funktion
"_timestwo".
timestwo.mexw32 : fatal error LNK1120: 1 nicht aufgelöste externe
Verweise (unresolved external symbol).

C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of
'timestwo.mexw32' failed.

??? Error using ==> mex at 221
Unable to complete successfully.
From: roger on
On Oct 29, 4:36 pm, Ralf <meteora...(a)gmx.net> wrote:
> Hello all,
>
> I am trying to compile a MEX-file, which uses an external library
> function. The library is available as "tcdlls.lib".
>
> But performing the compilation I get the following error. I have tried
> also copying the .lib file to the working directory, but this did not
> help. The library-file is correctly spelled. Using Visual Studio or
> LCC-compiler did not make any difference. What is going wrong?
>
> Thank you very much,
> Ralf
>
> >> mex timestwo.c -ltcdlls.lib -L"D:\Eigene Dateien\LibPath\"
>
> Warning: MEX could not find the library "tcdlls.lib"
>          specified with -l option on the path specified
>          with the -L option.
>    Bibliothek ".......\templib.x" und Objekt ".......\templib.exp"
> werden erstellt.
> timestwo.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
> Symbol (unresolved external symbol) "_tc_init_root" in Funktion
> "_timestwo".
> timestwo.mexw32 : fatal error LNK1120: 1 nicht aufgelöste externe
> Verweise (unresolved external symbol).
>
>   C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of
> 'timestwo.mexw32' failed.
>
> ??? Error using ==> mex at 221
> Unable to complete successfully.

it is in fact a link error, not a compile error but that's not really
the point.
Where are the templib.x and templib.exp files located? are they on the
right path?
R
From: James Tursa on
Ralf <meteoradix(a)gmx.net> wrote in message <a23855e8-0d6f-4496-b672-014203e218e1(a)p15g2000vbl.googlegroups.com>...
>
> I am trying to compile a MEX-file, which uses an external library
> function. The library is available as "tcdlls.lib".
>
> I have tried
> also copying the .lib file to the working directory, but this did not
> help.

What mex command did you use when you tried this method? I would expect this to work:

mex timestwo.c tcdlls.lib

James Tursa
From: Praetorian on
On Oct 29, 10:49 am, "James Tursa"
<aclassyguy_with_a_k_not_...(a)hotmail.com> wrote:
> Ralf <meteora...(a)gmx.net> wrote in message <a23855e8-0d6f-4496-b672-014203e21...(a)p15g2000vbl.googlegroups.com>...
>
> > I am trying to compile a MEX-file, which uses an external library
> > function. The library is available as "tcdlls.lib".
>
> > I have tried
> > also copying the .lib file to the working directory, but this did not
> > help.
>
> What mex command did you use when you tried this method? I would expect this to work:
>
> mex timestwo.c tcdlls.lib
>
> James Tursa

Do as James suggested, do no use the -l or -L directives, just list
the .lib files along with the list of source files. You can either
copy the library to the working directory or enter the path to
wherever it is located.

HTH,
Ashish.
From: Ralf on
On 29 Okt., 18:18, Praetorian <ashish.sadanan...(a)gmail.com> wrote:
> On Oct 29, 10:49 am, "James Tursa"
>
> <aclassyguy_with_a_k_not_...(a)hotmail.com> wrote:
> > Ralf <meteora...(a)gmx.net> wrote in message <a23855e8-0d6f-4496-b672-014203e21...(a)p15g2000vbl.googlegroups.com>...
>
> > > I am trying tocompilea MEX-file, which uses an external library
> > > function. The library is available as "tcdlls.lib".
>
> > > I have tried
> > > also copying the .lib file to the working directory, but this did not
> > > help.
>
> > What mex command did you use when you tried this method? I would expect this to work:
>
> > mex timestwo.c tcdlls.lib
>
> > James Tursa
>
> Do as James suggested, do no use the -l or -L directives, just list
> the .lib files along with the list of source files. You can either
> copy the library to the working directory or enter the path to
> wherever it is located.
>
> HTH,
> Ashish.

Thank you all,

using the commands

mex timestwo.c tcdlls.lib

or

mex timestwo.c "C:\......\tcdlls.lib"

works without problems.

Ralf

 | 
Pages: 1
Prev: MZDDE toolbox for Zemax
Next: PITCH DETECTION