LuckyLucks
asked on
passing command line argument to Visual Studio from cygwin
Hello
How can i pass an argument to a visual studio .exe (C++ project) from the command line i.e. cygwin?
Please note that I do not want to pass the argument via the Visual Studio GUI under debugger->Command Arguments.
So I would like something like this:
cygwin>a.exe 4
thanks
How can i pass an argument to a visual studio .exe (C++ project) from the command line i.e. cygwin?
Please note that I do not want to pass the argument via the Visual Studio GUI under debugger->Command Arguments.
So I would like something like this:
cygwin>a.exe 4
thanks
Create a script to execute your binary with whatever arguments you want and then get Visual Studio to run the script.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Paul, I could be wrong, but I don't think that's what the OP meant. At least, that's not how I read it.
I assumed that you built the program in Visual Studio using the GCC toolchain. The previous post applies to both C and C++.
Ricky, You could be right. Let us find out. I read it as the author wanted to take a program built in the visual studio IDE, and then run it from a cygwin command prompt.
ASKER
@phoffric: Yes, visual studio IDE, and then run it from a cygwin command prompt.
Lucky, I think Paul and I are seeking more clarification. Are you asking how to handle command line arguments with the C++ code (Paul already answered that) or how to run a binary via Visual Studio, but without having to pass arguments via Visual Studio (I've already answered that). Please clarify what you trying to do so that we may be able to help you better.
ASKER
phoffric, your suggestion is correct in theory. However when I run
a.exe 3
I get Error 1!
a.exe 3
I get Error 1!
ASKER
Closing. The error is from something at my end. Thanks phoffric.
You're very welcome. Glad to help.
Tip: When working with a new technique, start with a simple working example from the web, and then morph it slowly with intermittent build and tests till you reach your end game.
Tip: When working with a new technique, start with a simple working example from the web, and then morph it slowly with intermittent build and tests till you reach your end game.