Welcome, Guest. Please login or register.

Author Topic: Compiler  (Read 13959 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahc

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Compiler
« Reply #14 on: May 31, 2003, 01:27:50 AM »
Yeah, the dev cd was good to get me started.. now I'm changing to GCC for two reasons. StormC3.0 cant do 2d arrays, and I want my program to compile alright on OS 4.0. :)
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #15 on: May 31, 2003, 02:58:43 AM »
This is hopeless. I've been trying all day to get a compiler to work. The closest I have come is with vbcc, and I can get some example programs to compile with a load of warnings and which don't function properly when executed. If someone could help me out here i'd much appreciate it.
 

Offline jahc

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Compiler
« Reply #16 on: May 31, 2003, 03:04:08 AM »
For a beginner, I think StormC 3.0 on the Amiga Developer CD 2.1 is the easiest way to start up. I think all you need to do is copy the OS include files over, and you can start programming straight away. Run Snoopdos to see where its looking for those files, if its having trouble loading them. Get the 3.9 NDK off the net somewhere (do a search) to find the latest AmigaOS includes/header files..

Which version of the developer cd do you have?
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #17 on: May 31, 2003, 03:19:08 AM »
Thanks for mentioning that ndk, I found it on the amiga inc. website. :)
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #18 on: May 31, 2003, 04:14:19 AM »
Well looks like I finally got stormc working. However, none of the
example code will work. It compiles fine but when it gets to the
linking stage, I get a ton of linker errors saying Symbol "_FOO" is
not defined (it seems to say this for every function...). What might
be going on here?
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: Compiler
« Reply #19 on: May 31, 2003, 05:49:30 AM »
Quote

quiesce wrote:
Well looks like I finally got stormc working. However, none of the
example code will work. It compiles fine but when it gets to the
linking stage, I get a ton of linker errors saying Symbol "_FOO" is
not defined (it seems to say this for every function...). What might
be going on here?

yes ive had that problem too!  dont run the example code
just type in your own!
 

Offline jahc

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Compiler
« Reply #20 on: May 31, 2003, 08:42:39 AM »
Apparently there was a version of stormc that had linker issues... I dont know about that, but my StormC 3.0 on the 2.1 dev cd is fine. Try and get that version dev cd maybe..?
 

Offline Varthall

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 633
    • Show only replies by Varthall
Re: Compiler
« Reply #21 on: May 31, 2003, 10:09:20 AM »
I've taken a look at the gcc 2.7.0 distribution.
The missing env-archive/ and s/ files are in the
gcc270-readme archive (don't ask me why, it
would be more logical if they put them in the
base archive). Don't forget to copy the ixemul
library, but beware that all newer software that
uses ixemul require a recent version, so you'll
have to copy the old version everytime you want
to use gcc. There's another exe in the bin directory
(called gcc-vfork or something similar) that works
better with a newer library, but it doesn't work
very well.

Another option would be to get the complete gcc
2.9.5 (which should have 060 optimization, too)
from Louise's page:

http://louise.amiga.hu/index.php

It's a 11 megs gzipped file, which should include
a complete and fully working gcc compiler together
with some utilities. I've checked the homepage,
it looks like it has been revamped and I couldn't
find the archive, I hope it's still there...

Another source of precious information is here:

http://www.ezcyberspace.com/gcc/

Varthall
AmigaOne XE - AmigaOS 4.1 - Freescale 7457 1GHz - 1GB ram
MPlayer for OS4: https://sourceforge.net/projects/mplayer-amigaos/
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #22 on: May 31, 2003, 05:04:13 PM »
@iamaboringperson: Well I never feel safe in beginning to code until
at least -some- example code works. After copying over the latest libs
and header files from NDK3.9, I tried compiling several of the example
files both from the NDK AND those provided with  StormC. And the
errors they gave didn't seem to have any apparent reason for being
there.

For example, it once complained about a definition of a macro in a
header file, even though it was uniform with the other macro
definitions before and after it (they were function calls). I don't
remember the other details, but now this linking is giving me
problems...

@Varthall: Thanks a lot you found it. :) That should help me get gcc
running.
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #23 on: May 31, 2003, 06:17:46 PM »
Ok, it should be no surprise by now that I'm STILL having problems. I
tried doing what iamaboringperson suggested and wrote a simple
helloworld program in stormc. Here is the code:

#include

int main()
{
   printf("Hello world.\n");
   return 0;
}

And this is what I get:

Error: Unknown function "printf".
...ram:helloworld.c, Line 5: printf("Hello world\n")

I included the stdio header file and it can't find a printf function!?
That't pretty f***ed up if you ask me.

GCC i'm not having much better luck on... ixemul doesn't like it, when
I compile I get an ixemul window saying "ssystem() is no longer
supported. See the README document for more information. If you are
using gcc, then replace gcc with gccv.".

Well first of all I tried replacing my version of ixemul.library with
the one included in the gcc archive, but that turned out to be the
exact same latest version. I tried gccv and that seemed to `compile'
without problems... but then I tried running it and it wasn't an
executable!...
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #24 on: May 31, 2003, 07:42:28 PM »
I solved the compiling problem in stormc by copying accross the
includes from my  gcc directory... but now it hickups on the linking
again. Here's what I get:

Linker error: Symbol "_printf" not defined (Hint: "main()").
Ram Disk:hello.o symbol _printf hint main()
Linker error: Aborted.

If no one can help me, can they direct me somewhere like a developers
group that can help?

Also if anyone can find me an old version of ixemul.library or tell me
how to get gcc/gccv to work with a recent version of ixemul.library, i
would be grateful.
 

Offline Varthall

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 633
    • Show only replies by Varthall
Re: Compiler
« Reply #25 on: May 31, 2003, 07:49:01 PM »
The ixemul provided in gcc 2.7.0 is NOT the latest
version: it's the 41.4 compiled in '95. I don't
know which is the latest version, the most
uptodate version I have is the 48.0, date 14.7.98.
Remember that once a library is opened, it will
remain in memory and every program will use
that, not the copy in libs:. Maybe you have just
copied the old library over the new one, without
flushing the memory (with "avail flush" in a shell)
or resetting the machine.
I also remember gccv not working well, I guess that
it also doesn't support the newer ixemuls.

Don't lose hope, Quiesce, you've nearly made it ;)

Varthall
AmigaOne XE - AmigaOS 4.1 - Freescale 7457 1GHz - 1GB ram
MPlayer for OS4: https://sourceforge.net/projects/mplayer-amigaos/
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #26 on: May 31, 2003, 08:03:10 PM »
I stand corrected, it seems the version command doesn`t work properly.

And the latest version of ixemul is 48.2 or 48.3 I think.
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #27 on: May 31, 2003, 10:45:09 PM »
I've had gcc compile a simple program now, but it doesn't want to link
any libs. For instance, if I type:

c++ -l gcc:os-lib/reaction.lib test1.c -o test

A requester pops up saying:

Please insert volume
/gnu/lib/gcc-lib/mc68020-cbm-a
in any drive

After clicking cancel a few times it then asks for
"/local/lib/gcc-lib/mc68020-cbm" and then "/gnu/lib/libgcc" and then
"/local/lib/libgcc" and finally, in the shell window I get: ld: No
such file or directory for libgcc:lib/reaction.lib.a

Am I doing this right?
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #28 on: May 31, 2003, 10:50:52 PM »
And if I use the -lobjc argument I get ld: maformed input file (not
rel or archive) gcc:lib/reaction.lib
 

Offline quiesceTopic starter

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 72
    • Show only replies by quiesce
Re: Compiler
« Reply #29 from previous page: May 31, 2003, 11:32:36 PM »
After doing a little experimenting, the bottom line seems to be that gcc expects an .a extention to all linker libs, whereas the one i'm trying to link has a .lib extension. Renaming it doesn`t help, it thinks the file is corrupt. Can someone explain to me how to link the .lib files or why they won`t work?