|
|
Mex File: fatal error LNK1120: 7 unresolved externals
I am making mex file out of tsnnls_test1.cpp and all relevant headers are included.
I am getting linking error.
For instance, I can see the function t_snnls_spiv, _t_snnls etc are declared in tsnnls.h and defined in tsnnls.c.
Also, tsnnls.h is included in my code tsnnls_test1.cpp. Also, I have put all header file etc in the same folder as my original code.
The command I am running (all library included are the external library)
==================================================
>> mex tsnnls_test1.cpp BLAS_nowrap.lib clapack_nowrap.lib libf2c.lib BLASd_nowrap.lib clapackd_nowrap.lib libf2cd.lib
====================================================
The error I am getting:
===============================================
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
C:\DOCUME~1\DUSHYANT\LOCALS~1\TEMP\MEX_B7~1\tsnnls_test1.obj BLAS_nowrap.lib clapack_nowrap.lib libf2c.lib BLASd_nowrap.lib clapackd_nowrap.lib libf2cd.lib
Creating library C:\DOCUME~1\DUSHYANT\LOCALS~1\TEMP\MEX_B7~1\templib.x and object C:\DOCUME~1\DUSHYANT\LOCALS~1\TEMP\MEX_B7~1\templib.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
tsnnls_test1.obj : error LNK2019: unresolved external symbol _taucs_ccs_free referenced in function "void __cdecl tsnnls_test(struct taucs_ccs_matrix *,double *,double *)" (?tsnnls_test@@YAXPAUtaucs_ccs_matrix@@PAN1@Z)
……………..
tsnnls_test1.obj : error LNK2019: unresolved external symbol _t_snnls_spiv referenced in function "void __cdecl tsnnls_test(struct taucs_ccs_matrix *,double *,double *)" (?tsnnls_test@@YAXPAUtaucs_ccs_matrix@@PAN1@Z)
tsnnls_test1.obj : error LNK2019: unresolved external symbol _t_snnls referenced in function "void __cdecl tsnnls_test(struct taucs_ccs_matrix *,double *,double *)"
…….
tsnnls_test1.mexw32 : fatal error LNK1120: 7 unresolved externals
C:\PROGRA~1\MATLAB\R2009A\BIN\MEX.PL: Error: Link of 'tsnnls_test1.mexw32' failed.
|
|
0
|
|
|
|
Reply
|
Dushyant
|
12/6/2010 3:40:27 PM |
|
"I can see the function t_snnls_spiv, _t_snnls etc are declared in tsnnls.h and defined in tsnnls.c"
"The command I am running (all library included are the external library)
mex tsnnls_test1.cpp BLAS_nowrap.lib clapack_nowrap.lib libf2c.lib BLASd_nowrap.lib clapackd_nowrap.lib libf2cd.lib"
All source files must be explicitly specified for the mex function. In other words, you must add "tsnnls.c" to the list of files passed to the mex command, or it will not be included in the build.
-Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
12/13/2010 8:40:19 PM
|
|
|
1 Replies
716 Views
(page loaded in 0.001 seconds)
|
|
|
|
|
|
|
|
|