gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 10:17:27 24 4
gpt4 key购买 nike

我正在使用 Codeblocks 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

但是,当我(在同一个外壳中)运行以下行时:
/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 '
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!

我该如何解决它才能立即运行它?

最佳答案

我以这种方式修复它:
代码块->设置->环境设置
将选项“终端启动控制台程序”更改为:

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

关于c - MAC OS X : zsh: no such file or directory once running a program from Codeblocks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61010513/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com