Author Topic: Cant run code on macOS  (Read 290 times)

Offline LoneProgrammer

  • Single posting newcomer
  • *
  • Posts: 5
Cant run code on macOS
« on: May 09, 2020, 07:08:45 pm »
Hi everyone,
I'm new to C::B and C and after digging through the forums I cant find an answer to my question despite many similar posts.
I tried to run a basic "Hello World" program after installing the latest nightly build available for macOS 10.15 (12064) but when I hit build and run the console window at the bottom of the screen shows this and C::B freezes
Code: [Select]
-------------- Build: Debug in test (compiler: LLVM Clang Compiler)---------------

clang -Weverything -g  -c /Users/(user_name)/Desktop/Projects/test/main.c -o obj/Debug/main.o
clang  -o bin/Debug/test obj/Debug/main.o   

Even when I try to abort the build or close C::B nothing happens.
I ran this command in the terminal and was able to successfully compile and run the program, however.
Code: [Select]
clang Desktop/Projects/test/main.c -o Desktop/Projects/test/main I tried changing the Command Line Macro in the Settings->Compiler->Other Settings->Advanced Options panel to what I used in the terminal but that second line in the console still shows up and C::B freezes.
Does anyone know how to fix this?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Cant run code on macOS
« Reply #1 on: May 09, 2020, 07:57:07 pm »
I think there is a known run problem under macOS.

If you just try to build (without running) does that work?

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

Offline LoneProgrammer

  • Single posting newcomer
  • *
  • Posts: 5
Re: Cant run code on macOS
« Reply #2 on: May 09, 2020, 08:07:33 pm »
Hi Tim,
Code::Blocks freezes whether I try to build or build and run so itís probably on the build process itself. Like I said the build command works if I write it directly into the terminal but the second command the console shows does not work and shows an error in the terminal so that may be where the problem is coming from but again Iím new to all of this.
Thanks,
LoneProgrammer

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Cant run code on macOS
« Reply #3 on: May 09, 2020, 08:10:27 pm »
Do you have non ASCII characters or spaces in the CB Project path?

If yes, try building in a folder without  non ASCII characters or spaces in the path.

Edit: Also, revert your changes to advanced compiler settings.
Edit2: After revert your changes to advanced compiler settings.
  You might try unchecking "Use full paths for source file (GDB workaround)"
  That on tab "Commands" tab of advanced compiler options.

Tim S.
« Last Edit: May 09, 2020, 08:29:32 pm by stahta01 »
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

Offline LoneProgrammer

  • Single posting newcomer
  • *
  • Posts: 5
Re: Cant run code on macOS
« Reply #4 on: May 09, 2020, 08:29:06 pm »
There are no non-ASCII characters or spaces in the path

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Cant run code on macOS
« Reply #5 on: May 09, 2020, 08:30:59 pm »
Try my edited suggestions on prior post and post the new rebuild without running log.

Edit: I have nothing else to suggest; you will likely have to wait till a Mac or at least a better Linux person than me to get help.

Sorry, that I could not help you.

Tim S.
« Last Edit: May 09, 2020, 08:41:38 pm by stahta01 »
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

Offline LoneProgrammer

  • Single posting newcomer
  • *
  • Posts: 5
Re: Cant run code on macOS
« Reply #6 on: May 09, 2020, 08:41:11 pm »
This is the log with your suggestions
Code: [Select]
-------------- Build: Debug in test (compiler: LLVM Clang Compiler)---------------

clang -Weverything -g  -c main.c -o obj/Debug/main.o
clang  -o bin/Debug/test obj/Debug/main.o   

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6911
    • My Best Post
Re: Cant run code on macOS
« Reply #7 on: May 09, 2020, 08:44:36 pm »
This is an extreme long shoot; but, I think some OSes use the word "test" as a shell command.

You might try a different name for the project [output exe] instead of "test".

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