Sender: on the Sand of the Sahara Desert, the letter area: matlab
Title: MFC C / C package problem
Sending station: BBS Harbin Institute of Technology (Sun Aug 1 15:29:03 2004)
M file to turn C / C package problem
Does the program after the MCC can completely leave Matlab, in general, one principle can be followed, first use "MCC
-B SGLCPP file name "Test, Matlab generates an executable, then (on the same computer
Above) Run this executable file, if you can run success, you can guarantee that it can run in a fully detached environment. There are several things about being completely detached from Matlab.
1. Test the "MGLINSTALLER.EXE" file in the "MATLAB6P5 / EXTERN / LIB / WIN32" directory, in the target
When running on the machine, pay attention to keep the path after the decompression and the MATLAB installation path on the first computer.
. Of course, you can also directly extract it to the same directory of the program you want to run, or the system
Record, but I don't recommend this, why? Because you may need to copy files in some toolboxes,
The positions of these documents on the target machine must be the same as the position of the first machine. I can explain this.
Next, use the "MCC -B SGLCPP file name" to compile the following program:
%%%%%%%%%%%%%%%%%%%%%%%%%%
Function fork3 (f_image)
I = IMREAD (f_image);
IMSHOW (i)
%%%%%%%%%%%%%%%%%%%%%%%%%%
You can find the following in the main file "fork3_mainhg.cpp":
...................
Static const char * path_list_ [1] = {"C: / Matlab6p5 / Toolbox / Images / images"}
...................
This shows that the path "hardcodes" in the form of a string, does not move during program execution
The automatic search target machine path on the MATLAB toolbox, so the path on the two machines should be consistent.
2. In addition, it can be seen from this string that the operation of the program may need some east in the image processing toolbox.
West (pictures, DLL, etc.) but "mglinstaller.exe" does not pack things in the toolbox, so according to this way
The related files in the path of handmade copy toolboxes. If you can't determine those "related files", then you will copy it.
If you have used some other toolbox in the program, you have to make a manual copy.
3. After the above steps are completed, there is another thing to do, this path C: / Matlab6p5 / bin / win32 (according to you
The specific situation is different) add to the system environment variable PATH. (What is environment variable Path, in DOS
Type "Path" in the window, that is the environment variable) added to the method is (win2k) -> My Computer ---> Right button -
-> Properties ---> Advanced ---> Environment Variables ... The rest is to find Path to make changes.