Author Topic: Problems running my first code - Help would be appreciated  (Read 3041 times)

Offline johns18

  • Single posting newcomer
  • *
  • Posts: 3
Problems running my first code - Help would be appreciated
« on: August 17, 2015, 06:31:33 pm »
New to coding. Am reading "C Programming Absolute Beginner's Guide". I was instructed to download Code::Blocks to use as I learn to code using C. I followed these steps.

1.visit codblocks.org
2.click Downloads on left side
3.choose binaries
4.chose Mac OS X (that is what I use)
5.downloaded through sourceforge.net
6.once downloaded, open and open new empty file
7.type code specified

/* Prints a message on the screen */
#include <stdio.h>
main()
{
    printf ("Just one small step for coders. One giant leap for");
    printf (" programmers!\n");
    return 0;
}

8.click build and run icon or build icon and then run icon

These are exactly all the steps I was given. When I click the "build and run" icon nothing happens. If I only click "build" nothing happens and then I click "run" a little box appears that says "Information-It seems this file has not been built yet. Do you want to build now?" If I select yes, nothing happens. If i select no, a couple "terminal-bash" boxes appear with a few lines of writing that I do not recognize on them.

Would someone be able to point me in the right direction? I apologize if my problem comes across as ignorant, I am extremely new to code::blocks and coding.

Thank you!



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Problems running my first code - Help would be appreciated
« Reply #1 on: August 17, 2015, 07:04:25 pm »
Did you install a Compiler?

If yes, please give info about the Compiler.

Note: Code::Blocks is NOT a compiler.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline johns18

  • Single posting newcomer
  • *
  • Posts: 3
Re: Problems running my first code - Help would be appreciated
« Reply #2 on: August 17, 2015, 07:23:25 pm »
Thank you for your response, Tim.

Code::Blocks is all I downloaded. I guess I thought the compiler was included with it.

Do you have a compiler you would recommend I download?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Problems running my first code - Help would be appreciated
« Reply #3 on: August 17, 2015, 07:27:00 pm »
Do you have a compiler you would recommend I download?

Here is the CB Wiki Link on the subject http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Mac_OS_X

In the past I had found a better link on the Internet; but, I can NOT find it today.

Your Mac OSX version number would likely be needed by the Mac experts; but, there are few Mac experts on this site.

I have used Mac OSX once in a classroom at College; I do NOT count as a Mac User.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Problems running my first code - Help would be appreciated
« Reply #4 on: August 18, 2015, 03:48:44 am »
Did you create a project or just trying to compile a single file?

Offline johns18

  • Single posting newcomer
  • *
  • Posts: 3
Re: Problems running my first code - Help would be appreciated
« Reply #5 on: August 18, 2015, 06:05:21 am »
@Tim-thank you and I will try your suggestion.

@scarphin-thank you for the reply-all I did was download code::blocks and try to "build and run" those few lines of code. Those were all of the instructions I was given but it looks like I need to download a compiler as well.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Problems running my first code - Help would be appreciated
« Reply #6 on: August 18, 2015, 11:21:02 am »
You sure need a compiler but if you don't create a project for your code after you install a compiler, you'll only have the option to 'compile single file' which I'm not even sure creates any executable.
Beware.