mex files link error

9 views (last 30 days)
merve
merve on 30 Dec 2014
Answered: merve on 13 Jan 2015
i use matlab 2013 x32 and visual studio 2008 sp1 but every time i get this fatal error.
LINK : error LNK2001: unresolved external symbol mexFunction
...mex_ZIBcNM\templib.x : fatal error LNK1120: 1 unresolved externals
D:\MATLAB\R2013A\BIN\MEX.PL: Error: Link of 'libqp_gsmo.mexw32' failed.
  1 Comment
Geoff Hayes
Geoff Hayes on 30 Dec 2014
Merve - please provide some context surrounding this error. What are you executing that result in this error message? If you are building a MEX file from the Command Window, then please include this statement.

Sign in to comment.

Accepted Answer

merve
merve on 13 Jan 2015
i reinstall matlab R2013a x64 (because my machine is x64) and install sdk 7.1(to do this remove all .net frameworks,sdk versions and any runtimes firstly).
then in the "mex-setup" i choose sdk7.1 (it is "[1] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 " ).
in my folder i have two different source code: my pure c code(the function) and my mex function. i move this mex function into pure c code function.(do not forget to add #include "mex.h") and then It Works!
thanks for all answers and comments....

More Answers (1)

Jan
Jan on 30 Dec 2014
Does your source file contain a mexFunction definition?
  5 Comments
merve
merve on 6 Jan 2015
Edited: merve on 7 Jan 2015
after compiling -v it says; Contents of C:\Users\lenovo\AppData\Local\Temp\mex_7Jd3gr\mex_tmp.rsp: C:\Users\lenovo\AppData\Local\Temp\mex_7Jd3gr\libqp_gsmo.obj
.obj file is in my current folder on matlab but it is not exist in C:\Users\lenovo\AppData\Local\Temp\mex_7Jd3gr\
thanks for help
Titus Edelhofer
Titus Edelhofer on 7 Jan 2015
In this case you should (re-)run "mex -setup" to configure the mex options.
Titus

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!