1

In VS2010 I set command line arguments in the project settings->Debugging->Command line arguments:

-d 48000 1 -raw test1.opus test1_decoded.raw

However, when I debug the project and have a look at the argv[] in

int main(int argc, char *argv[])
{
}

... I can see that these command line arguments are missing. The command line argument argv instead has only the path to the exe that is just being debugged. I see that if I move the mouse over the argv.

Does anybody have an idea what I might have done wrong?

Thank you for the help.

asked May 12, 2013 at 18:22

1 Answer 1

1

However, when I debug the project and have a look at the argv[]...

Per your description and code, I'm assuming that you are hovering your mouse over argv or looking at it in the watch window. argv is a pointer to pointer to char. The debugger does not know how many elements it contains. It will show you the first element i.e.,*argv`), but no more because there is simply no safe, standard way of doing so.

Your command line arguments are there, but the debugger cannot figure out how many elements to display in the UI. Look at the value of argc; that should match your number of arguments +1 for the path to your executable.

answered May 12, 2013 at 18:36
Sign up to request clarification or add additional context in comments.

3 Comments

Also, forced re-compiling is necessary. I thought VS2010 would do that automatically after changing the cmd line args, but that is not the case.
@tmighty: That's interesting. Are you certain that you actually saved the setting before running again? Command line args have nothing to do with the compiled binary.
@tmighty Why should the system recompile anything just because you've changed the command line arguments?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.