Code::Blocks Forums

User forums => Help => Topic started by: modeezy23 on February 16, 2019, 03:31:48 pm

Title: CAN'T RUN ON MAC..HELP!!!
Post by: modeezy23 on February 16, 2019, 03:31:48 pm
I'm new to programming and a currently learning C programming.
I installed Xcode and code blocks onto my mac. I'm trying to run the hello world code but its giving me this:

THIS ON CODE BLOCKS:

-------------- Run: Debug in Hello World (compiler: GNU GCC Compiler)---------------

Checking for existence: /Users/msenador/Desktop/Hello World/bin/Debug/Hello World
Executing: osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/msenador/Desktop/Hello\ World/bin/Debug/Hello\ World "' -e 'end tell'  (in /Users/msenador/Desktop/Hello World/.)
Process terminated with status 0 (0 minute(s), 2 second(s))
 

AND THIS ON MY TERMINAL WHENEVER I TRY TO RUN IT:

/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/msenador/Desktop/Hello World/bin/Debug/Hello World
Morians-MacBook-Pro:~ msenador$ /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/msenador/Desktop/Hello World/bin/Debug/Hello World
sh: /Users/msenador/Desktop/Hello: No such file or directory

Process returned 127 (0x7F)   execution time : 0.006 s
Press ENTER to continue.
Title: Re: CAN'T RUN ON MAC..HELP!!!
Post by: stahta01 on February 16, 2019, 03:51:44 pm
Try to build project in a path without spaces or non ASCII characters in it.

Tim S.

Title: Re: CAN'T RUN ON MAC..HELP!!!
Post by: Agus Hardiman on February 24, 2019, 08:16:18 am
Try to build project in a path without spaces or non ASCII characters in it.

Tim S.
Thanks, I choose on my Mac a folder which has no space and it solved my problem like the OP problems !

Btw strange that in this 2019 year, CodeBlocks don't know how to interpret folder with spaces  ???
I can't even give my project name with spaces or it will be a problem like the OP  :-\
Title: Re: CAN'T RUN ON MAC..HELP!!!
Post by: BlueHazzard on February 24, 2019, 08:18:11 pm
Mostly it is not a codeblocks problem, but a compiler or operating system problem.... Codeblocks takes the paths and feeds them transparently...
We probably have to introduce escaping, but honestly spaces and non ascii charachters are a bad choose for paths, because they are not the same on every operating system (encoding), or are used to separate parameters (spaces)....
So the easiest and 100% secure way is to use "_" instead of spaces and use ascii characters for paths...
Title: Re: CAN'T RUN ON MAC..HELP!!!
Post by: oBFusCATed on February 25, 2019, 02:21:32 am
Mostly it is not a codeblocks problem, but a compiler or operating system problem.... Codeblocks takes the paths and feeds them transparently...
This statement is wrong. If the user has specified something that is valid on his system and C::B fails to obey and do the right thing then it is 100% C::B's fault.

In this case this is 100% true also. The way launching a console has changed and we don't do the right thing. This needs to be fixed, for example CodeLite works correctly in this case I think.
Title: Re: CAN'T RUN ON MAC..HELP!!!
Post by: noahguyblog on September 24, 2020, 08:03:39 am
Try to build project in a path without spaces or non ASCII characters in it.

Tim S.

I am having the same issue.  How exactly can the space issue be fixed? Should you adjust the file path in project settings & where is this? I’ve been trying to solve this for 2 days. 
Title: Re: CAN'T RUN ON MAC..HELP!!!
Post by: oBFusCATed on September 25, 2020, 01:01:33 am
You have to make sure that absolute paths made for files in the project doesn't contain any non-ascii characters.