Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAC OS X: zsh: no such file or directory once running a program from Codeblocks

I am building and running a c program using Codeblocks IDE and this is what I get on the shell:

XX@XX-MBP ~ % '/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner 
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/XX/Desktop/Codeblocks/try2/bin/Debug/try2 '
zsh: no such file or directory: 
/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner 
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/XX/Desktop/Codeblocks/try2/bin/Debug/try2 

however when I run (in the same shell) the following line:

/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner 
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/XX/Desktop/Codeblocks/try2/bin/Debug/try2

It does work as expected:

XX@XX-MBP ~ % '/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner 
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/XX/Desktop/Codeblocks/try2/bin/Debug/try2 '
zsh: no such file or directory: 
/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner 
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/XX/Desktop/Codeblocks/try2/bin/Debug/try2 
XX@XX-MBP ~ % /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner 
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/XX/Desktop/Codeblocks/try2/bin/Debug/try2
Hello world!

How can I solve it so it would run it right away?

like image 955
Asa'ad Balum Avatar asked Nov 07 '25 18:11

Asa'ad Balum


1 Answers

I fix it in this way: Codeblocks->Setting->Environment setting Change the option "Terminal to launch console programs" to this:

osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "$SCRIPT"' -e 'end tell'

Regards

like image 182
Freddy Avatar answered Nov 09 '25 10:11

Freddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!