I want to build a .exe file using deploytool but it's not able to build the file.Errors : 1.mexFunction already defined 2. LINK : fatal error LNK1561: entry point must be defined. The log is given below:-

1 view (last 30 days)
>> mcc -o lelo -W WinMain:lelo -T link:exe -d C:\Users\rajat\Desktop\mm\lelo\src -w
enable:specified_file_mismatch -w enable:repeated_file -w enable:switch_ignored -w
enable:missing_lib_sentinel -w enable:demo_license -v 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\SuperResoltionWithTraining.m' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\ArmijoBacktrack.m' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\autoGrad.m' -a 'C:\Users\rajat\Dropbox\Super Resolution
for Cab Sec\minFunc\autoHess.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\autoHv.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\autoTensor.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\callOutput.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\conjGrad.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\dampedUpdate.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\example_minFunc.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\example_minFunc_LR.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\isLegal.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgs.m'
'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.c' -a 'C:\Users
\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.mexa64' -a 'C:\Users\rajat
\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.mexglx' -a 'C:\Users\rajat\Dropbox
\Super Resolution for Cab Sec\minFunc\lbfgsC.mexmac' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\lbfgsC.mexmaci' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\lbfgsC.mexmaci64' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\lbfgsC.mexw32' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\lbfgsC.mexw64' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\lbfgsUpdate.m' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\logistic\LogisticDiagPrecond.m' -a 'C:\Users\rajat
\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\LogisticHv.m' -a 'C:\Users\rajat
\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\LogisticLoss.m' -a 'C:\Users
\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\mchol.m' 'C:\Users\rajat\Dropbox
\Super Resolution for Cab Sec\minFunc\mcholC.c' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\mcholC.mexmaci64' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\mcholC.mexw32' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\mcholC.mexw64' -a 'C:\Users\rajat\Dropbox\Super
Resolution for Cab Sec\minFunc\mcholinc.m' 'C:\Users\rajat\Dropbox\Super Resolution for
Cab Sec\minFunc\logistic\mexutil.c' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab
Sec\minFunc\logistic\mexutil.h' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\minFunc.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\minFunc_processInputOptions.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\logistic\mylogsumexp.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab
Sec\minFunc\polyinterp.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\precondDiag.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\precondTriu.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\precondTriuDiag.m' 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\logistic\repmatC.c' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\logistic\repmatC.dll' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\logistic\repmatC.mexglx' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\logistic\repmatC.mexmac' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab
Sec\minFunc\rosenbrock.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\taylorModel.m' -a 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\WolfeLineSearch.m'
Compiler version: 4.18 (R2012b)
Processing C:\Program Files\MATLAB\R2012b\toolbox\matlab\mcc.enc
Processing C:\Program Files\MATLAB\R2012b\toolbox\images\mcc.enc
Processing C:\Program Files\MATLAB\R2012b\toolbox\shared\spcuilib\mcc.enc
Processing include files...
2 item(s) added.
Processing directories installed with MCR...
The file C:\Users\rajat\Desktop\mm\lelo\src\mccExcludedFiles.log contains a list of
functions excluded from the CTF archive.
0 item(s) added.
Generating MATLAB path for the compiled application...
Created 48 path items.
Begin validation of MEX files: Sun May 18 09:25:04 2014
Validating 'C:\Program Files\MATLAB\R2012b\toolbox\images\images\private
\grayto8.mexw64'.
Found MATLAB file 'C:\Program Files\MATLAB\R2012b\toolbox\images\images\private
\grayto8.m'.
MEX file
'C:\Program Files\MATLAB\R2012b\toolbox\images\images\private\grayto8.mexw64'
is valid. It contains 'mexFunction.'
Validating 'C:\Program Files\MATLAB\R2012b\toolbox\images\images\private
\imresizemex.mexw64'.
No conflicting MATLAB file found.
Validating 'C:\Program Files\MATLAB\R2012b\toolbox\images\images\private
\ind2rgb8c.mexw64'.
No conflicting MATLAB file found.
Validating 'C:\Program Files\MATLAB\R2012b\toolbox\images\images\private
\int16touint16.mexw64'.
No conflicting MATLAB file found.
Validating 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.mexw64'.
No conflicting MATLAB file found.
Validating 'C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\mcholC.mexw64'.
No conflicting MATLAB file found.
End validation of MEX files: Sun May 18 09:25:04 2014
Warning: Adding path "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec" to
Compiler path instance.
Parsing file "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\SuperResoltionWithTraining.m"
(Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2012b\toolbox\compiler\deploy\deployprint.m"
(Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2012b\toolbox\compiler\deploy\printdlg.m"
(Referenced from: "Compiler Command Line").
Deleting 13 temporary MEX authorization files.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_15464_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_24217_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_23978_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_16953_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_30520_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_22631_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_31687_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_9868_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_27264_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_2312_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_2230_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_26765_6952.auth'.
Removing: 'C:\Users\rajat\AppData\Local\Temp\mathworks_tmp_6952_6736_6952.auth'.
Executing command: ""C:\Program Files\MATLAB\R2012b\bin\mbuild" -O -v -output "lelo" -
I"C:\Users\rajat\Desktop\mm\lelo\src" "C:\Users\rajat\Dropbox\Super Resolution for Cab
Sec\minFunc\lbfgsC.c" "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc
\mcholC.c" "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic
\mexutil.c" "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic
\repmatC.c" -link exe -env MCR_DELAYLOAD=/delayload:mclmcrrt8_0.dll -env
MCR_DELAYLIB=delayimp.lib -outdir "C:\Users\rajat\Desktop\mm\lelo\src""-> Default
options filename found in C:\Users\rajat\AppData\Roaming\MathWorks\MATLAB\R2012b
----------------------------------------------------------------
-> Options file = C:\Users\rajat\AppData\Roaming\MathWorks\MATLAB\R2012b
\compopts.bat
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = -MD -c -Zp8 -GR -W3 -EHsc- -Zc:wchar_t- -nologo
/D_CRT_SECURE_NO_DEPRECATE
OPTIMFLAGS = -O2 -DNDEBUG
DEBUGFLAGS = -Z7
arguments = -IC:\Users\rajat\Desktop\mm\lelo\src
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /MACHINE:AMD64 kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib /LIBPATH:"C:\PROGRA~1\MATLAB\R2012b\extern\lib\win64\microsoft"
/nologo /manifest /manifestfile:"C:\Users\rajat\Desktop\mm\lelo\src\lelo.msvc.manifest"
mclmcrrt.lib delayimp.lib /delayload:mclmcrrt8_0.dll
LINKFLAGSPOST =
Name directive = /out:"C:\Users\rajat\Desktop\mm\lelo\src\lelo.exe"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "C:\Users\rajat\Desktop\mm\lelo\src\.res"
-> Resource Linker =
----------------------------------------------------------------
--> cl -IC:\Users\rajat\Desktop\mm\lelo\src -MD -c -Zp8 -GR -W3 -EHsc- -Zc:wchar_t- -
nologo /D_CRT_SECURE_NO_DEPRECATE /FoC:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd
\lbfgsC.obj -IC:\PROGRA~1\MATLAB\R2012b\extern\include -IC:\PROGRA~1\MATLAB\R2012b
\simulink\include -O2 -DNDEBUG "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\lbfgsC.c"
lbfgsC.c
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.c(26) : warning
C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.c(27) : warning
C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\lbfgsC.c(41) : warning
C4133: 'function' : incompatible types - from 'int [2]' to 'const mwSize *'
--> cl -IC:\Users\rajat\Desktop\mm\lelo\src -MD -c -Zp8 -GR -W3 -EHsc- -Zc:wchar_t- -
nologo /D_CRT_SECURE_NO_DEPRECATE /FoC:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd
\mcholC.obj -IC:\PROGRA~1\MATLAB\R2012b\extern\include -IC:\PROGRA~1\MATLAB\R2012b
\simulink\include -O2 -DNDEBUG "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\mcholC.c"
mcholC.c
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\mcholC.c(80) : warning
C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\mcholC.c(85) : warning
C4133: 'function' : incompatible types - from 'int [2]' to 'const mwSize *'
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\mcholC.c(89) : warning
C4133: 'function' : incompatible types - from 'int [2]' to 'const mwSize *'
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\mcholC.c(91) : warning
C4133: 'function' : incompatible types - from 'int [2]' to 'const mwSize *'
--> cl -IC:\Users\rajat\Desktop\mm\lelo\src -MD -c -Zp8 -GR -W3 -EHsc- -Zc:wchar_t- -
nologo /D_CRT_SECURE_NO_DEPRECATE /FoC:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd
\mexutil.obj -IC:\PROGRA~1\MATLAB\R2012b\extern\include -IC:\PROGRA~1\MATLAB\R2012b
\simulink\include -O2 -DNDEBUG "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\logistic\mexutil.c"
mexutil.c
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\mexutil.c(15) :
warning C4133: 'function' : incompatible types - from 'int *' to 'const mwSize *'
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\mexutil.c(17) :
warning C4133: 'function' : incompatible types - from 'const int *' to 'const mwSize *'
--> cl -IC:\Users\rajat\Desktop\mm\lelo\src -MD -c -Zp8 -GR -W3 -EHsc- -Zc:wchar_t- -
nologo /D_CRT_SECURE_NO_DEPRECATE /FoC:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd
\repmatC.obj -IC:\PROGRA~1\MATLAB\R2012b\extern\include -IC:\PROGRA~1\MATLAB\R2012b
\simulink\include -O2 -DNDEBUG "C:\Users\rajat\Dropbox\Super Resolution for Cab Sec
\minFunc\logistic\repmatC.c"
repmatC.c
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\repmatC.c(77) :
warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\repmatC.c(78) :
warning C4133: '=' : incompatible types - from 'const mwSize *' to 'const int *'
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\repmatC.c(79) :
warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\repmatC.c(89) :
warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\Users\rajat\Dropbox\Super Resolution for Cab Sec\minFunc\logistic\repmatC.c(125) :
warning C4133: 'function' : incompatible types - from 'int *' to 'const mwSize *'
Contents of C:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd\mbuild_tmp.rsp:
C:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd\lbfgsC.obj C:\Users\rajat\AppData
\Local\Temp\mbuild_ZqEsLd\mcholC.obj C:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd
\mexutil.obj C:\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd\repmatC.obj
--> link /out:"C:\Users\rajat\Desktop\mm\lelo\src\lelo.exe" /MACHINE:AMD64 kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /LIBPATH:"C:\PROGRA~1\MATLAB\R2012b
\extern\lib\win64\microsoft" /nologo /manifest /manifestfile:"C:\Users\rajat\Desktop\mm
\lelo\src\lelo.msvc.manifest" mclmcrrt.lib delayimp.lib /delayload:mclmcrrt8_0.dll @C:
\Users\rajat\AppData\Local\Temp\mbuild_ZqEsLd\mbuild_tmp.rsp
mcholC.obj : error LNK2005: mexFunction already defined in lbfgsC.obj
repmatC.obj : error LNK2005: mexFunction already defined in lbfgsC.obj
LINK : fatal error LNK1561: entry point must be defined
C:\PROGRA~1\MATLAB\R2012B\BIN\MEX.PL: Error: Link of 'C:\Users\rajat\Desktop\mm\lelo
\src\lelo.exe' failed.
Error: An error occurred while shelling out to mbuild (error code = 2).
Unable to build executable.
Error using mcc
Error executing mcc, return status = 1 (0x1).

Accepted Answer

Friedrich
Friedrich on 20 May 2014
Hi,
please compile without adding the source code to your MEX files. So please remove lbfgsC.c lbfgsC.c, lbfgsC.c, mexutil.h and repmatC.c (and the .c and .h files I missed here) from the MCC call and try again.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by