作者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