如果先安裝AMESIM墙杯,后安裝VC++編譯器,AMESIM編譯時可能提示找不到可執(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、打開AMESim下misc目錄中的RunAMESimTemplate.bat苫耸,將其中set AME=***改為本機實際的AMESIM的安裝目錄州邢,例如set AME=D:\AMESim\v800,然后運行該批處理文件褪子。
注意量淌,該批處理文件默認只讀,可將其只讀屬性取消再修改其內(nèi)容褐筛。
實質(zhì)解決方案:
當我們運行AMEsim类少,再次編譯時,可能仍然無法編譯渔扎,原因是環(huán)境變量問題。運行RunAMESimTemplate.bat打開的AMEsim可以編譯信轿,否則不可以編譯晃痴,那么RunAMESimTemplate.bat中隱藏了什么呢残吩?讓我們打開該文件看看:
@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
這個批處理文件關(guān)鍵的語句是:
set AME=d:\AMESim\v800
SET PATH=%AME%;%AME%\win32;%AME%\mingw32\bin;%PATH%
start %AME%\win32\AMESim
前兩個語句設(shè)置了環(huán)境變量,第三個啟動AMEsim軟件倘核。也就是說泣侮,是環(huán)境變量設(shè)置有問題。
打開操作系統(tǒng)環(huán)境設(shè)置窗口紧唱,在系統(tǒng)變量Path中添加%AME%;%AME%\win32;%AME%\mingw32\bin活尊,并保存。再次打開AMEsim漏益,進行編譯蛹锰,就可以通過編譯(有可能需要先重啟系統(tǒng),使得環(huán)境變量生效)绰疤。
如果還有問題铜犬,建議仔細分析一下這兩個文件:%AME%\AMEcompile80.bat(AMESim編譯批處理文件)和%AME%\vcvars32.bat(AMESim調(diào)用VC++編譯器批處理文件)