如果先安裝AMESIM,后安裝VC++編譯器,AMESIM編譯時(shí)可能提示找不到可執(zhí)行文件。下面是可能的解決方案。
環(huán)境:
操作系統(tǒng):XP,x86
軟件:AMESIM 8A(安裝目錄:D:\AMESim\v800,路徑中不能有中文、空格等),VC++6.0(安裝目錄:D:\Program Files\Microsoft Visual Studio)
處理辦法:
1、將VC++編譯器中的Bin\vcvars32.bat拷貝到AMESIM安裝目錄下;
2、打開(kāi)AMESim下misc目錄中的RunAMESimTemplate.bat,將其中set AME=***改為本機(jī)實(shí)際的AMESIM的安裝目錄,例如set AME=D:\AMESim\v800,然后運(yùn)行該批處理文件。
注意,該批處理文件默認(rèn)只讀,可將其只讀屬性取消再修改其內(nèi)容。
實(shí)質(zhì)解決方案:
當(dāng)我們運(yùn)行AMEsim,再次編譯時(shí),可能仍然無(wú)法編譯,原因是環(huán)境變量問(wèn)題。運(yùn)行RunAMESimTemplate.bat打開(kāi)的AMEsim可以編譯,否則不可以編譯,那么RunAMESimTemplate.bat中隱藏了什么呢?讓我們打開(kāi)該文件看看:
@echo off
echo This is an example on how to run an AMESim version which
echo is different from the latest one.? You can use this,
echo for instance, to run AMESim x.y on a machine where you have
echo installed AMESim z.t.? Lines after "CHANGE THIS" are likely
echo to be changed.
REM The setlocal makes any changes to environment variables local
REM between here and the endlocal flag.
setlocal
REM We define the AME environment variable:
REM this will of course be different for each usage.
REM CHANGE THIS
set AME=d:\AMESim\v800
REM Here are defined environment variable for MSVC++
call %AME%\vcvars32.bat
REM We can here also change directory to where we want to start
REM for instance "c:\ametest".
REM CHANGE THIS
rem cd c:\ametest
REM then we set up the path to include the AME directory (and the licensing directory).
SET PATH=%AME%;%AME%\win32;%AME%\mingw32\bin;%PATH%
REM Finally run AMESim, using the AME environment variable to make
REM sure that we run the AMESim we want to run.
start %AME%\win32\AMESim
endlocal
REM Make the DOS window wait for a key press, to catch any error printouts
pause
這個(gè)批處理文件關(guān)鍵的語(yǔ)句是:
set AME=d:\AMESim\v800
SET PATH=%AME%;%AME%\win32;%AME%\mingw32\bin;%PATH%
start %AME%\win32\AMESim
前兩個(gè)語(yǔ)句設(shè)置了環(huán)境變量,第三個(gè)啟動(dòng)AMEsim軟件。也就是說(shuō),是環(huán)境變量設(shè)置有問(wèn)題。
打開(kāi)操作系統(tǒng)環(huán)境設(shè)置窗口,在系統(tǒng)變量Path中添加%AME%;%AME%\win32;%AME%\mingw32\bin,并保存。再次打開(kāi)AMEsim,進(jìn)行編譯,就可以通過(guò)編譯(有可能需要先重啟系統(tǒng),使得環(huán)境變量生效)。
如果還有問(wèn)題,建議仔細(xì)分析一下這兩個(gè)文件:%AME%\AMEcompile80.bat(AMESim編譯批處理文件)和%AME%\vcvars32.bat(AMESim調(diào)用VC++編譯器批處理文件)