이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi
I have generated a package with some GUIs and functions and some supporting files like shapefiles, images etc.
But after deploying that package into .exe form, supporting shapefiles (.shp) files are not working. Then I have tried to use them by converting into matrix (.mat)file, but then also its not working.
Why MATLAB deployed .exe is not able to read .shp and .mat files?
Please help me out in this regard. Any sort of help is appreciated.
Thanks in advance.
채택된 답변
Image Analyst
2013년 7월 14일
Chances are you didn't specify the full filename of the files and just ignored any folder and assumed the file will be in the same folder as the executable. Bad assumption. For this to even have a chance of working, you'd have to bundle the files with the executable with the -a option. The reason is that the executable you think you are running is not the real executable but a self-unarchiving program that unpacks the real executable somewhere else but does not copy everything else (like the special files you shipped) in that folder to there. Better is to put these files into a known folder, then use fullfile() to construct the full path name of the file, and use exist(fullFileName, 'file') to check that the file exists before you try to do anything with it. It's just robust programming.
댓글 수: 5
Thanks for the reply image analyst, but it did not work. Please find the below my code and how I called shapefiles by using fullfile() as suggested by you.
%Construct file path------------
f = fullfile('C:','Users','ICRS','Desktop','package','shapefile');
% Check existance -------------------------------------------
shp_dec=exist([f,'\IND_adm1.shp']);
if shp_dec==2
uiwait(msgbox('file exists','modal'));
else
uiwait(msgbox('file doesnt exist','modal'));
end
%-----------------------------------------------------------
% Shapefile read for country boundries --------------------
% border=shaperead([f,'\IND_adm0.shp']); % Reads the shape file of borders of india. states=shaperead([f,'\IND_adm1.shp']); % Reads the states of india.
JK=shaperead([f,'\india_state.shp']); % Reads the states of india. %------------------------------------------------------------
% Loop to show country boundries to overwrite on sm map-----------------
for i=1:14 geoshow(states(i,1).Y, states(i,1).X,'Color', 'blue','LineWidth',2); % reads the 35*1 matrics of IND_adm1.shp end for i=16:35 geoshow(states(i,1).Y, states(i,1).X,'Color', 'blue','LineWidth',2); % reads the 35*1 matrics of IND_adm1.shp end for i=1:35 geoshow(JK(i,1).Y,JK(i,1).X,'Color', 'blue','LineWidth',2); % reads the 35*1 matrics of IND_adm1.shp end %-------------------------------------------------------
and Here is the log file generated during deployment...
ant:<br><ant><br> <mkdir dir="C:\Users\ICRS\Desktop\map\distrib" /><br> <mkdir dir="C:\Users\ICRS\Desktop\map\src" /><br></ant> mcc -o map -W WinMain:map -T link:exe -d C:\Users\ICRS\Desktop\map\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\ICRS\Desktop\package\start.m -a C:\Users\ICRS\Desktop\package\database -a C:\Users\ICRS\Desktop\package\function -a C:\Users\ICRS\Desktop\package\gui -a C:\Users\ICRS\Desktop\package\help -a C:\Users\ICRS\Desktop\package\image -a C:\Users\ICRS\Desktop\package\shapefile Compiler version: 4.15 (R2011a) Processing C:\Program Files\MATLAB\R2011a\toolbox\matlab\mcc.enc Processing C:\Program Files\MATLAB\R2011a\toolbox\map\mcc.enc Processing C:\Program Files\MATLAB\R2011a\toolbox\stats\mcc.enc Processing C:\Users\ICRS\Desktop\package\gui\HRSM_Calculation.fig Processing C:\Users\ICRS\Desktop\package\gui\HRSM_Mapping.fig Processing C:\Users\ICRS\Desktop\package\gui\HRSM_Mapping_Successful.fig Processing C:\Program Files\MATLAB\R2011a\toolbox\images\mcc.enc Processing C:\Users\ICRS\Desktop\package\gui\LST_Gen.fig Processing C:\Users\ICRS\Desktop\package\gui\Login_page.fig Processing C:\Users\ICRS\Desktop\package\gui\Operation_Successful.fig Processing C:\Users\ICRS\Desktop\package\gui\Pre_Processing_Module.fig Processing C:\Users\ICRS\Desktop\package\gui\Pre_Processing_Operation_Successful.fig Processing C:\Users\ICRS\Desktop\package\gui\SDS_Generation.fig Processing C:\Users\ICRS\Desktop\package\gui\Soil_Moisture_Mapping_Package.fig Processing C:\Program Files\MATLAB\R2011a\toolbox\finance\mcc.enc Processing C:\Program Files\MATLAB\R2011a\toolbox\shared\maputils\mcc.enc Processing C:\Program Files\MATLAB\R2011a\toolbox\shared\mapgeodesy\mcc.enc Processing C:\Program Files\MATLAB\R2011a\toolbox\shared\imageslib\mcc.enc Processing C:\Program Files\MATLAB\R2011a\toolbox\matlab\guide\guideopts.fig Processing C:\Program Files\MATLAB\R2011a\toolbox\matlab\winfun\actxcontrolselect.fig Processing C:\Program Files\MATLAB\R2011a\toolbox\matlab\winfun\actxcontrolcreateproperty.fig Processing include files... 2 item(s) added. Processing directories installed with MCR... The file C:\Users\ICRS\Desktop\map\src\mccExcludedFiles.log contains a list of functions excluded from the CTF archive. 2 item(s) added. Generating MATLAB path for the compiled application... Created 60 path items. Begin validation of MEX files: Wed Jul 17 11:41:27 2013 Validating 'C:\Program Files\MATLAB\R2011a\toolbox\compiler\componentinfo.mexw64'. Found MATLAB file 'C:\Program Files\MATLAB\R2011a\toolbox\compiler\componentinfo.m'. MEX file 'C:\Program Files\MATLAB\R2011a\toolbox\compiler\componentinfo.mexw64' is valid. It contains 'mexFunction.' Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptformats\private\bitparse.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptformats\private\dicom_decode_rle_segment.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptformats\private\dicomlookup_helper.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptformats\private\dicomparse.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptformats\private\rnitfc.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptformats\private\tobits.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptutils\iptcheckinput.mexw64'. Found MATLAB file 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptutils\iptcheckinput.m'. MEX file 'C:\Program Files\MATLAB\R2011a\toolbox\images\iptutils\iptcheckinput.mexw64' is valid. It contains 'mexFunction.' Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\map\private\checkinput_mex.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\map\private\gpcmex.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\map\private\ind2rgb8c.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\mapdisp\private\checkinput_mex.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\mapformats\private\checkinput_mex.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\mapformats\private\gtifinfo.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\map\mapformats\private\sdtsmex.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\DNToMatrix.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\MatrixToDN.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\computeDN.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\convertToDouble.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\matrixBitXor.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\sobolIndexed.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\sobolNet.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\sobolPoint.mexw64'. No conflicting MATLAB file found. Validating 'C:\Program Files\MATLAB\R2011a\toolbox\stats\stats\@sobolset\private\sobolSequence.mexw64'. No conflicting MATLAB file found. End validation of MEX files: Wed Jul 17 11:41:27 2013 Parsing file "C:\Users\ICRS\Desktop\package\start.m" (Referenced from: "Compiler Command Line"). Parsing file "C:\Program Files\MATLAB\R2011a\toolbox\compiler\deploy\deployprint.m" (Referenced from: "Compiler Command Line"). Parsing file "C:\Program Files\MATLAB\R2011a\toolbox\compiler\deploy\printdlg.m" (Referenced from: "Compiler Command Line"). Deleting 24 temporary MEX authorization files. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_19068_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_4833_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_8292_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_27120_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_1151_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_9965_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_8773_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_7553_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_25710_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_9337_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_10709_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_32116_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_31473_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_28446_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_2972_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_21521_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_21728_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_20029_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_29819_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_10314_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_3280_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_16283_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_7254_5444.auth'. Removing: 'C:\Users\ICRS\AppData\Local\Temp\mathworks_tmp_5444_22533_5444.auth'. Generating file "C:\Users\ICRS\Desktop\map\src\readme.txt". copy 'C:\Users\ICRS\Desktop\map\src\readme.txt' 'C:\Users\ICRS\Desktop\map\distrib\readme.txt' copy 'C:\Users\ICRS\Desktop\map\src\map.exe' 'C:\Users\ICRS\Desktop\map\distrib\map.exe'
Sorry to bother you again but it would be so kind of you if you would help me out in this regard. Thanks in advance.
what error do you get when running the generated exe?
I am getting no error Friedrich but the moment when shapefiles supposed to work, it does not work and the application seems to be paused up. I am also using geoshow function is that creating any problem?
Mhh, can you narrow down the line where it hangs or stops? (add some disp commands) Please compile it as console application and run it from a DOS prompt/shell in order to see any warning/error which might be thrown.
Thanks friedrich and Image analyst. It worked now since i added the path for landareas.shp, earlier it was not included.
Thanks
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
