if there is 1 button for build and run ,like in codeblocks it would be nice so i tried this command but did not work. to set build commands ;
g++ -Wall -o "%e" "%f" && "./%e"
can some one point out which command line should i write ?
&& is a shell construct, so it would have to be used as an execute command which is run in a shell
so which command should i use to make geany build and run at same time ? could you give the command. http://stackoverflow.com/questions/37777590/how-to-config-geany-to-build-and... there are people asking the same question but so far no helpful soluton on google.
Your command will work, but you have to set it as an execute command, not a compile or build command as they are run without a shell. Or you can make the compile or build command run a shell and pass your command to it with the -c option.
here it is i do ; set build command --> c++ command --> and here in the are of build i pasted the code so in idea when i hit the build button it will build and run so i dont have to hit the build button and then run button after that
g++ -Wall -o "%e" "%f" && "./%e" -c so i put -c option and did not work could you please explain in simplex way so i can understand.
As I said above, the `compile` and `build` commands are NOT run in a shell so you can't use && in them unless you run the shell yourself and pass the command to the -c option of the shell command. The `execute` command IS run in a shell, so you can have it compile and run using your command without changing it.
ok so the short answer there is no way to do it. in geany 1 click build and run impossible.thank for taking your time
It is possible, you have been told two ways of doing it above.
i am not a native english user and not really familiar with those terms .as far as i understand you are telling me i can not do 1 click and run with any command i will paste there.you are suggesting me to open shell and do it by typing my hand everytime .which is even more time consuming than clicking build and run seperetaly.
i can not do 1 click and run with any command i will paste there
You can use exactly that command in the Geany menus if you set it as a command in the execute group (near the bottom) in the `Set Build Commands` dialog.
You cannot use exactly that exact command in any of the other command sets because `&&` is a shell feature, and only commands in the execute group run the command you set in a shell.
you are suggesting me to open shell and do it by typing my hand everytime
No, you are misunderstanding me, you set the command in Geany to run the shell and pass it your command as the -c option to the shell command. Set `/bin/sh -c "your_command"` as the command in Geany. (note the quotes around your command)
oh i got it now! thank you very much with your patience sir.
Hey @elextr I'm having the same issue literally 7 years later from you, If you have a pic of your Build Commands or know how to solve it. I'd appreciate it so much...
I can use && on my RPi version of Geany to compile and run. However in Windows I only got error 81: Invalid command-line option, "&&".
@pik33 as I said many times above `&&` is a _shell_ construct. Windows does not run commands in a Unix shell, so you cannot use `&&`.