Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Linker problem

17 views
Skip to first unread message

Cédric Devivier

unread,
Feb 9, 2010, 8:02:05 AM2/9/10
to
Hello,

I try to compile a mex file using matlab R2009b 64bits with Visual Studio 2008 (Microsoft .NET runtime 3.5 sp1) under Windows 7 64bits and I encounter this problem.

>>mex -g mf2.cpp graph.cpp maxflow.cpp
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

C:\USERS\CDRIC~1\APPDATA\LOCAL\TEMP\MEX_NC~1\mf2.obj C:\USERS\CDRIC~1\APPDATA\LOCAL\TEMP\MEX_NC~1\graph.obj C:\USERS\CDRIC~1\APPDATA\LOCAL\TEMP\MEX_NC~1\maxflow.obj
Library creation C:\USERS\CDRIC~1\APPDATA\LOCAL\TEMP\MEX_NC~1\templib.x and object C:\USERS\CDRIC~1\APPDATA\LOCAL\TEMP\MEX_NC~1\templib.exp
mf2.obj : error LNK2019: unresolved external symbol _mxCreateNumericArray_700 referenced in function "void __cdecl mf2(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?mf2@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
mf2.obj : error LNK2019: unresolved external symbol _mxGetM referenced in function "void __cdecl mf2(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?mf2@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
mf2.obj : error LNK2019: unresolved external symbol _mxGetN referenced in function "void __cdecl mf2(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?mf2@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
mf2.obj : error LNK2019: unresolved external symbol _mxGetPr referenced in function "void __cdecl mf2(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?mf2@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
mf2.mexw64 : fatal error LNK1120: 4 unresolved externals

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

??? Error using ==> mex at 221
Unable to complete successfully.

I tried all the things in the newscentral but none of them resolved it.
Thank you for your help.
Cédric

Cédric Devivier

unread,
Mar 5, 2010, 6:50:19 AM3/5/10
to
In fact, the problem was that I should install Visual studio first and then matlab else it is not recognized properly.
0 new messages