Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Trouble at linking stage with Matlab 2011 and Microsoft Visual C++ 2010

1 view (last 30 days)
I am using the 2011 version of Matlab and Microsoft Visual C++ 2010. I ran mex -setup fine, no problems. I checked the paths in the mexext file to make sure they were getting set properly at the setup stage, and that all looked fine. If I do mex -c test.c, I get no errors. So it doesn't seem to be a compilation problem. But if I do mex test.c I get what seems to be an error indicating that something is going wrong at the link stage. Any help would be greatly appreciated.
Here's the error message I am getting: >> mex test.c LINK : error LNK2001: unresolved external symbol mexFunction C:\Users\cprose\AppData\Local\Temp\mex_71ByMo\templib.x : fatal error LNK1120: 1 unresolved externals
C:\PROGRA~1\MATLAB\R2011A\BIN\MEX.PL: Error: Link of 'test.mexw64' failed.
??? Error using ==> mex at 208 Unable to complete successfully.

Answers (2)

Kaustubha Govind
Kaustubha Govind on 12 May 2012
All MEX-functions need to have an entrypoint function call mexFunction - it looks like you have not defined it in test.c. Look at the MEX documentation for examples.

Michael
Michael on 22 May 2012
Hi Carolyn, did you find a way to fix your problem? I have the same one.
  1 Comment
Kaustubha Govind
Kaustubha Govind on 23 May 2012
Michael: Did my answer not help you? Do you have a function called "mexFunction" in your MEX-file?

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!