资源描述:
《mex+MSVCExpress》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、mini-HOWTO:mex+MicrosoftVisualStudio2005ExpressEditionWilliamFoxwillfox@mit.edu1Aug2007AbstractThisdocumentdescribeshowtosetuptocompileC-languagemexleswiththefreeMicrosoftVisualC/C++2005ExpressEditioncompiler.YouwillcompileyourmexleusingtheMatlabcommandlinetoolmex,ratherthancreatingprojectsandc
2、ompilingwithintheVisualStudioIDE.Thestepsareasstreamlinedaspossibleandrequirenohackingonanyofthemexsetuples.1Historyversion1.18Dec2006.InitialRevision.Coveredmex+MSVCforMatlabR2006b.version1.21Aug2007.RevisedtoencompassMatlabR2007a.URLtogetVCExpresshasbeenupdated.AddedreferencetoMathworkswebsite
3、.2IntroductionMicrosoftnowdistributesVisualStudio2005ExpressEdition"forfree,whichincludestheExpressEditionVisualC/C++"compiler(hereafterVCExpress").ThisdocumentgrewoutofanattempttomakeVCExpressworkwithMatlab7.3(R2006b).Thisrequiredsometrickery,becausetheExpressEditionwasnotanociallysupportedc
4、ompiler;onlytheProfessionalEdition($$)was.WiththereleaseofMatlab7.4,(R2007a),theExpressEditionisnowanociallysupportedcompilerformex.Asaresultofitsnew-foundstatus,theinstallprocedureisslightlydierent,sothisdocumentcontainsseparateinstructionsbasedonyourversionofMatlab.Whydoweneedahowto?Thehitchi
5、sthat,outofthebox,VCExpresscanonlygen-erate.NET-basedprograms,notWin32
6、regular"Windows
7、programs,anditdoesnotcomepackagedwithallofthestandardwindowslibrary(.lib)les(kernel32.lib,user32.lib,etc).Now,evenifyoudon'tneedtomakeWin32callsfromwithinyourmexle,mexby1defaultasksthelinkertolinkagainstseve
8、ralofthesestandardWin32libraries,andwillfailifitcannotndthem.Thus,mexwillnotworkwithVCExpressstraightoutofthebox.Sincewe'dprefertodozerohackingonthemexsetup,wewantthoselibraries.Fortunately,MicrosoftalsodistributesaWindowsPlatformSDK,"whichcontainsthenecessarylibraryandheaderlesasafreedownload
9、.Onceyouhavetheseles,andmexcanndthem,mexwillbeperfectlyhappytocompileusingVCExpress.Analnote:Matlabalreadycomesbundledwithacompiler(atleastonWindows),calledlcc.Trytouselccrst;itshouldworkoutoftheboxformany(most?)no