作者ric2k1 (Ric)
看板EE_DSnP
標題Re: [問題] Hw5記憶體區段錯誤
時間Sat May 10 10:46:31 2008
※ 引述《lendlicewang (鴛刀鴦刀情人看刀)》之銘言:
: 我的程式在adtp -v或是adtp -r
: 就會記憶體區短錯誤
: 但似乎是在AdtAddCmd::exec(const string& option)裡就發生錯誤
: 連 if (myStrNCmp("-Value", options[0], 2) == 0)
: 或是else if (myStrNCmp("-Random", options[0], 2) == 0)
: 還沒執行完就發生錯誤
嗯, 檢查一下 options 的 size, 或者是用 debugger 看看,
若看不出來, 再告訴我 debugger 的 error message
: 請問是哪裡的問題呢
: 另外在include的地方也非常怪
: 似乎cmdParser.h沒有link....??
: 我download下來的hw5.tgz裡沒有cmd這個資料夾
: 不知道這樣是正常的嗎(所以cmdPaser.h沒有連結到)
: 或是說這次作業本來就不需要cmd資料夾??
As I said in the word/pdf file, the libcmd.a is provided.
Therefore, you don't need the cmd package. The Makefile is modified so that
the cmd package is not needed for compilation, but the linker will include
libcmd.a for making the executable.
The header "cmdParser.h" is "copied" to the include directory so that other
source files can see it. This is the typical way of releasing a tool without
revealing the source code (i.e. only provide .a and .h files).
: 找了很久推斷不出其他的原因
: 還請老師指教
: 謝謝老師
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.121.130.151
1F:推 lendlicewang:謝謝教授 我找到我的問題所在了 ~"~ 05/10 14:35