Welcome, Guest. Please login or register.

Author Topic: Super Newbie C questions & MorphOS SDK  (Read 5426 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jjTopic starter

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4051
  • Country: wales
  • Thanked: 2 times
  • Gender: Male
    • Show only replies by jj
Super Newbie C questions & MorphOS SDK
« on: September 02, 2010, 05:45:21 PM »
Posted this on  MorphZone also but more help the better :)


Hi All

Trying to learn C with the C for dummies book and the MorphOS SDK.

Entered first bit of code and try and complie and get an error about missing makefile.

How do I create this ?

Sorry my programming skills are in Basic only so please be gentle.

Code below. Could be the next must have app :)


#include

int main()
{
printf("goodbye, cruel world!\n);
return(0);
}
“We don't stop playing because we grow old; we grow old because we stop playing.” - George Bernard Shaw

Xbox Live: S0ulA55a551n2
 
Registered MorphsOS 3.13 user on Powerbook G4 15"
 

Offline jjTopic starter

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4051
  • Country: wales
  • Thanked: 2 times
  • Gender: Male
    • Show only replies by jj
Re: Super Newbie C questions & MorphOS SDK
« Reply #1 on: September 02, 2010, 06:08:19 PM »
got a reply

need to compile at command line  with

gcc -noixemul goodbye.c -o test
“We don't stop playing because we grow old; we grow old because we stop playing.” - George Bernard Shaw

Xbox Live: S0ulA55a551n2
 
Registered MorphsOS 3.13 user on Powerbook G4 15"
 

Offline spirantho

Re: Super Newbie C questions & MorphOS SDK
« Reply #2 on: September 02, 2010, 08:41:50 PM »
You'll also want an extra quote on your printf() line. :)
--
Ian Gledhill
ian.gledhill@btinternit.com (except it should be internEt of course...!)
Check out my shop! http://www.mutant-caterpillar.co.uk/shop/ - for 8-bit (and soon 16-bit) goodness!
 

Offline krashan

  • Full Member
  • ***
  • Join Date: Jan 2003
  • Posts: 247
  • Country: pl
  • Thanked: 1 times
  • Gender: Male
  • Hardware designer and programmer
    • Show only replies by krashan
    • Personal homepage
Re: Super Newbie C questions & MorphOS SDK
« Reply #3 on: September 03, 2010, 07:26:33 AM »
Quote from: JJ;577358
gcc -noixemul goodbye.c -o test


After moving to bigger projects, you may also use -O2 (or -O3), which turns on compiler optimization engine and -s, which strips symbol table and other debug informations from the executable.

Offline jjTopic starter

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4051
  • Country: wales
  • Thanked: 2 times
  • Gender: Male
    • Show only replies by jj
Re: Super Newbie C questions & MorphOS SDK
« Reply #4 on: September 03, 2010, 11:28:19 AM »
Dont think will need to worry about that until I get opnto porting doom 3 :)
“We don't stop playing because we grow old; we grow old because we stop playing.” - George Bernard Shaw

Xbox Live: S0ulA55a551n2
 
Registered MorphsOS 3.13 user on Powerbook G4 15"