I am running Code::Blocks version Code::Blocks SVN11712 on macOS Mojave (version 10.14.5). The compiler I use is gcc
version 9.1 .
When I test a simple c++ program, build process is OK. The log is as follows:
-------------- Build: Debug in gcctest (compiler: GNU GCC Compiler)---------------
g++-9 -Wall -fexceptions -g -c /Users/kaiyan/Documents/test/codeblocks/gcctest/main.cpp -o obj/Debug/main.o
g++-9 -o bin/Debug/gcctest obj/Debug/main.o
Output file is bin/Debug/gcctest with size 9.71 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
But when I run the programe, the mac terminal displays "No such file or directory." the logs is:
-------------- Run: Debug in gcctest (compiler: GNU GCC Compiler)---------------
Checking for existence: /Users/kaiyan/Documents/test/codeblocks/gcctest/bin/Debug/gcctest
Set variable: DYLD_LIBRARY_PATH=.:
Executing: osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script quoted form of "/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/kaiyan/Documents/test/codeblocks/gcctest/bin/Debug/gcctest "' -e 'end tell' (in /Users/kaiyan/Documents/test/codeblocks/gcctest/.)
Process terminated with status 0 (0 minute(s), 3 second(s))
the mac terminal display as follows:
Last login: Thu Jun 27 10:48:54 on ttys008
yamliddeMacBook-Pro:~ yamlid$ '/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/yamlid/Documents/test/codeblocks/gcctest/bin/Debug/gcctest '
-sh: /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/yamlid/Documents/test/codeblocks/gcctest/bin/Debug/gcctest : No such file or directory
I am sure there is no space in the path. the problem seems to be the '', and the mac terminal interpret between the '...cb_console_runner ...' as a whole command.
how to fixed it?
all. screenshot were included in attachment.