Author Topic: CAN'T RUN ON MAC..HELP!!!  (Read 6065 times)

Offline modeezy23

  • Single posting newcomer
  • *
  • Posts: 5
CAN'T RUN ON MAC..HELP!!!
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6996
    • My Best Post
Re: CAN'T RUN ON MAC..HELP!!!
« Reply #1 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.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Agus Hardiman

  • Guest
Re: CAN'T RUN ON MAC..HELP!!!
« Reply #2 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  :-\
« Last Edit: February 24, 2019, 08:21:09 am by Agus Hardiman »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2842
Re: CAN'T RUN ON MAC..HELP!!!
« Reply #3 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...
« Last Edit: February 24, 2019, 08:19:54 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12821
    • Travis build status
Re: CAN'T RUN ON MAC..HELP!!!
« Reply #4 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline noahguyblog

  • Single posting newcomer
  • *
  • Posts: 1
Re: CAN'T RUN ON MAC..HELP!!!
« Reply #5 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. 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12821
    • Travis build status
Re: CAN'T RUN ON MAC..HELP!!!
« Reply #6 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]