Code::Blocks Forums

User forums => Help => Topic started by: jackNewport on January 20, 2022, 03:51:34 pm

Title: Can't Run C Code MacOS Terminal
Post by: jackNewport on January 20, 2022, 03:51:34 pm
This is the first time that I have tried to use Code::blocks, and when I try to run a simple C script (just hello world) I get this error in the Mac Terminal:
 
Code
'/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /filePath '

conmputer:~ user$ '/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /filePath/bin/Debug/firstCDocument '

-bash: /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /filePath/bin/Debug/firstCDocument : No such file or directory

I have a feeling that this is a dumb mistake that is easily fixed, but I'm having trouble finding an answer. Thanks!
Title: Re: Can't Run C Code MacOS Terminal
Post by: jordi on January 20, 2022, 07:24:44 pm
From cb_console_runner man page:
"cb_console_runner  is part of the Code::Blocks IDE. It is used to launch console programs and wait for them to finish.  When the console program is finished, cb_console_runner displays "Press ENTER to continue".
It doesn't have any sense to use it in a terminal.
You could try:
/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner /filePath/bin/Debug/firstCDocument
cb_console_runner expects an executable file as first argument