[問題] C++ call system 的問題

看板C_and_CPP作者 (ㄚ威)時間13年前 (2012/07/22 16:36), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) C++ in MS Visual Studio 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 因為實驗需要所以用C++來call System來執行Hspice, 本來在之前較舊的電腦上執行無誤, 日前更換了新的電腦,於新的電腦上執行相同的程式卻出現了錯誤。 Hspice手動執行的話可以正確執行,於cmd視窗下輸入與程式中相同的命令也 可以正常的執行,初步推斷問題應不是出在要CALL的程式上。 想請問何種情形會出現如下的訊息,那可能有何解呢? 餵入的資料(Input): 預期的正確結果(Expected Output): 正確執行: "***** job concluded" 錯誤結果(Wrong Output): 執行視窗顯示: " SetEnvironmentVariable failed (87) " 程式碼(Code):(請善用置底文網頁, 記得排版) #include<iostream> #include "stdio.h" #include "stdlib.h" using namespace std; int main() { system("C:\\synopsys\\hspice_A-2008.03\\BIN\\hspice D:\\Hspice\\Current\\180nm\\invtest.sp -o D:\\Hspice\\Current\\180nm\\invtest_o"); return 0; } 補充說明(Supplement): 先謝謝大家的解答! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.144.184 ※ 編輯: wei813 來自: 140.113.144.184 (07/22 16:38)

07/22 17:49, , 1F
路徑問題?
07/22 17:49, 1F
文章代碼(AID): #1G2xk5lD (C_and_CPP)