简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM