Welcome, Guest. Please login or register.

Author Topic: compiling assembly.s files in gcc ... was: gcc wont compile with // comments?  (Read 13515 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
is that right?

it's c code (adoom)

it says "parse error before /" on line 1 of every file.

yes i know // is c++ but it's also c99

gcc 270 is 8 years old or something so is pre 99?


bloody hell all i want to do is compile something and i have to say that gnu lacks so much in terms of FAQs and actual usefull online docs that dont require a lifetime of not having a girlfriend and instead shagging a unix box until you only see the world around you in terms of matrix code.


if you montior these forums you'll know i have a stab at using gcc every so often and i can compile hello world ok on:

1. an amiga
2. a UAE amiga on my PC
3. on my PC

but i'd love to be able to cross compile. and i'm halfway through being able to do that except for the aforementioned rocket science. bloody hell

edit: i have no trouble typing raw c / c++ into microsoft's visual studio and hitting the "build" button by the way. cept i cant use that to make amiga stuff!


 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16878
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: gcc wont compile with // comments?
« Reply #1 on: November 18, 2003, 12:56:03 AM »
Why not try to compile your C in C++ mode? A good C program is usually a C++ program too. C that doesn't compile in C++ mode often makes use of dodgy stuff like implicit casting from void* and so on.

I usually tend to compile C stuff in C++ mode as I prefer C++'s stricter enforcemnt of the language rules anyway.

If you want to do C99 stuff, vbcc also supports a few of the C99 extensions.
int p; // A
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
Re: gcc wont compile with // comments?
« Reply #2 on: November 18, 2003, 01:33:10 AM »
well i went back and started over, i still get the same issues using gcc but now when i use g++ it just says

make: *** [obj/doomdefs.o] Error 1

after, apparently, succesfully compiling doomdef.c ... bah!

makefile:

edit 3: makefile chopped

edit: oh bloody hell! i asserted that i do indeed have gcc270 by unLHAing the arcs into my gnu dir and suddenly it cant find any of my amiga includes! i forgot how to configure that

edit 2: ok so i found a 295 build somewhere and nearly set  it up ok except it says there's no include path or something for it to find the includes... i just copied them all into gnu/include and it STILL cant find them argh! now i cant even compile my "test" code which is a standard amigaos prog that simply opens a wb window with text in that you can close... .... nooooo!  it used to work as it was the first thing i got going the first time i got gnu going.... noooo!

someone come to my house, slap me round the face and proceed to say. YOU'RE SUPPOSED TO CONFIGURE GCC LIKE THIS!
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16878
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: gcc wont compile with // comments?
« Reply #3 on: November 18, 2003, 03:13:03 AM »
I hear ya buddy. Whilst I rate it as a compiler, I utterly *despise* gcc as a piece of software viewed from a user perspective.

I am not stupid and would regard myself a competent C/C++ programmer. Even my asm isn't too dreadful. So why is it I have *never* got it set up correctly without at least 5 attempts!

To anybody working with / maintaining the  amiga gcc port(s): For the love of God, please create a proper installer!
int p; // A
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
Re: gcc wont compile with // comments?
« Reply #4 on: November 18, 2003, 11:04:32 AM »
ditto, dammit

 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
Re: gcc wont compile with // comments?
« Reply #5 on: November 18, 2003, 12:53:20 PM »
well i found a backup of a working gcc setup. good job that. now i can compile my test window program again. it's a good test one as it invokes a few amiga libs so for it to woork my headers etc have to be set up the same.

i've experimented with simply inserting the gcc bin from 295 and 330 into my setup but it simply wont have it. and anyway, how come every gcc distro has a totally different directory structure with bins and libs in a million subfolders. yeah i know all about targetting and processors but FFS cant it jsut all go in /bin /lib and /include and have that as that!?
 

Offline Amiga1200PPC

  • Newbie
  • *
  • Join Date: Sep 2002
  • Posts: 25
    • Show only replies by Amiga1200PPC
Re: gcc wont compile with // comments?
« Reply #6 on: November 18, 2003, 02:01:12 PM »
For Amiga m68k use the GeekGadgets.
Works quite niceley.

VBCC has a switch for // comments.
In gcc I can't find any at the moment.
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
Re: gcc wont compile with // comments?
« Reply #7 on: November 18, 2003, 02:27:46 PM »
cpp has a -lang-C++ switch which alledgedly allows // comments to be used by gcc but i havent managed to get gcc to pass the argument on to cpp, either that or it's ignoring it.

as for geekgadgets the /current folder has about 1 million tgz files in it and the \alpha\gcc dir has the aforementioned 295 and 330 in, both of which i cant get to work, at all. i probably need some other files to go with them or something.

like was said before. isnt there just a ####ing installer or would that be too easy?

edit: the gg site has an install doc page which lists the packages to get. so i've set my ftp prog off getting, well, everything. i'm in a mind to zip up my "working" 270 for other people to use.
 

Offline gnarly

  • Sr. Member
  • ****
  • Join Date: Feb 2002
  • Posts: 351
    • Show only replies by gnarly
    • http://thinkdrastic.net/
Re: gcc wont compile with // comments?
« Reply #8 on: November 18, 2003, 02:34:53 PM »
Quote
cycloid wrote:
like was said before. isnt there just a ####ing installer or would that be too easy?
Dont be silly. l337 haxx0rs don't need no stinking installers  ;-)
Cheers,

Olly
Think Drastic
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16878
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: gcc wont compile with // comments?
« Reply #9 on: November 18, 2003, 03:35:31 PM »
Don't try that bollocks with me, sir. I have a zero tolerence rating for such terminology. Users of non-words like 'l337' and 'w00t' should all be lined up against a wall and shot...

..yes, I am kidding :-)
int p; // A
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
Re: gcc wont compile with // comments?
« Reply #10 on: November 18, 2003, 03:43:54 PM »
bugger, i downloaded an entire snapshot (990529/bin) from geekgadgets and it doesnt even contain a gcc archive... eh!?!? oh and all the arcs have different version numbers.

someone please help
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
Re: gcc wont compile with // comments?
« Reply #11 on: November 20, 2003, 01:00:51 AM »
it works! someone on a newsgroup pointed me at the mammoth 80mb golded install download, which i duly dowloaded and installed, then cropped out the gcc 295 and 330 distros. all 99% preconfigured by the installer. hurrah!

unfortunatley i still have the exact same problem i had before: __asm does not work. some minor google scouring seems to suggest that gcc has traditionally bad asm support. but i obviously need asm to be able to link into various os libraries, for example.

so: anyone know how to __asm a function in gcc?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16878
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: gcc wont compile with // comments?
« Reply #12 on: November 20, 2003, 01:05:49 AM »
Hey dude, is that the golded demo on their site or another one?
int p; // A
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show only replies by cycloid
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16878
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: gcc wont compile with // comments?
« Reply #14 on: November 20, 2003, 01:24:19 AM »
Hmm, thats the one I already got. IIRC the installer skipped gcc saying it wasnt included for size reasons...Better have a closer look at it :lol:

-edit-

Just did - the one I had was 14Mb compressed so not the same at all :-)
int p; // A