简体   繁体   English

MAC OS X:zsh:从 Codeblocks 运行程序后,没有这样的文件或目录

[英]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:我正在使用代码块 IDE 构建和运行 c 程序,这就是我在 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:我以这种方式修复它: Codeblocks->Setting->Environment setting 将选项“终端启动控制台程序”更改为:

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

Regards问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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