Welcome, Guest. Please login or register.

Author Topic: Probably a very simple development question...  (Read 4369 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Matt_HTopic starter

Probably a very simple development question...
« on: October 28, 2008, 04:17:32 AM »
Partially an exercise in teaching myself about (re)compiling and the GCC environment, I'm trying to fix a very simple bug in the Amiga port of Duke Nukem. Obviously, I've hit a snag.

After all the object code compiles and the compiler moves on to creating the executable, I get this error:
Code: [Select]
Engine/amiga_display.o(.text+0xb0e): undefined reference to `GetCyberIDAttr'
Engine/amiga_display.o(.text+0x3c4): undefined reference to `BestCModeIDTags'
Engine/amiga_display.o(.text+0x47a): undefined reference to `GetCyberIDAttr'
Engine/amiga_display.o(.text+0xaf8): undefined reference to `IsCyberModeID'
Engine/amiga_display.o(.text+0xf06): undefined reference to `LockBitMapTags'
Engine/amiga_display.o(.text+0xf46): undefined reference to `UnLockBitMap'
collect2: ld returned 1 exit status
make: *** [AmigaDuke3D_C] Error 1

Those all seem to be functions from cybergraphics.library. I'm sure the solution is something incredibly basic, but I don't (yet) know enough to figure it out.

The code should supposedly compile out of the box, but it doesn't, so I'm assuming the problem is with my development environment. The only "weird" thing I've done is used an included makefile that works only from C code, rather than the mix of C and Assembler - I'm having a hard enough time with C alone, so I don't want to deal with them both.

I'm using a basic (read: extracted everything and ran the GG-Startup script at boot) Geek Gadgets install from the ~1998 snapshot at Back2Roots with the gcc-2.95.3-4 from the FTP's alpha directory tacked on.

The os-includes were copied over from my Geek Gadgets 2 CD. I also installed the CGX and AHI devkits in gg:include.

Any hints greatly appreciated.
 

Offline HellCoder

  • Sr. Member
  • ****
  • Join Date: Jun 2004
  • Posts: 279
    • Show only replies by HellCoder
    • http://elasticore.nl
Re: Probably a very simple development question...
« Reply #1 on: October 28, 2008, 06:36:30 AM »
It looks like the compiler cannot find the library(s) from cybergraphics. Normally all libraries you want to link with the executable should be mentioned somewere in the makefile. (a reference)


 

Offline Crumb

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show only replies by Crumb
    • http://cuaz.sourceforge.net
Re: Probably a very simple development question...
« Reply #2 on: October 28, 2008, 08:37:20 AM »
C includes must be adapted to work on all compilers or at least the compiler you are using.

You'll need to use fd2pragma or a similar tool.

Perhaps you'll find aweb includes useful (AFAIK they are already adapted for GCC and OS4/OS3/MOS): http://aweb.sunsite.dk/



if your includes are already adapted that errors may have appeared because you haven't included the function prototypes.

You may have to add a:
#include
or even a
#include

you should never have to add:
#include
and you should never have to add
#include
as proto/cybergraphx.h should already choose that files. if you use inline or clib headers instead of proto ones your code won't be directly portable to other compilers (gcc uses "inline/" directory but other compilers don't.

good luck!
The only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)
 

Offline Matt_HTopic starter

Re: Probably a very simple development question...
« Reply #3 on: October 28, 2008, 03:42:11 PM »
@ Crumb

Yes! The GCC-adapted includes were the solution. Thanks.

I guess this explains why the Geek Gadgets documentation said that if you use includes that aren't from the Geek Gadgets CD that they need to have patches applied.

I was wondering if you could explain a little bit more on the conceptual level. What are FD files? I've seen them in devkits before, but they don't come installed with Geek Gadgets, SAS/C, or StormC v3. Is there a compiler that uses them, or is their only purpose to be converted into pragma files?

Similarly, the AWeb includes had both "pragma" and "pragmas" subdirectories. What's the difference? GG and SAS both have only a pragmas subdirectory, but StormC has both. Is this also a compiler-specific thing?

Thanks again.
 

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: Probably a very simple development question...
« Reply #4 on: October 28, 2008, 04:12:38 PM »
Pragmas are compiler-specific.

FD-files are basic files defining function-names offsets and paramaters for a library, and can be used to generate not just pragmas but binding for all languages (starting with AmugaBasic if you like).
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline Crumb

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show only replies by Crumb
    • http://cuaz.sourceforge.net
Re: Probably a very simple development question...
« Reply #5 on: October 28, 2008, 04:22:47 PM »
As Kronos explained it correctly I'll just add that GCC uses the inline/ directory instead of "pragma"/"Pragmas" and that OS4 uses different directories like "inline4/".

I created this small script to create 68k headers for gcc with fd2pragma: http://cuaz.sourceforge.net/cuaz/files/AAT_Create_includes

and this one for MorphOS:
http://cuaz.sourceforge.net/cuaz/files/AAT_Create_includes_MOS
The only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)
 

Offline Matt_HTopic starter

Re: Probably a very simple development question...
« Reply #6 on: October 28, 2008, 07:01:57 PM »
So is it correct to say that FDs are a kind of "raw" data that get processed into protos/pragmas/inlines/etc? I.E., if I have the FD files but nothing else, I can get everything else from them (apart from the main includes, obviously)?
 

Offline asymetrix

  • Full Member
  • ***
  • Join Date: May 2007
  • Posts: 118
    • Show only replies by asymetrix
Re: Probably a very simple development question...
« Reply #7 on: November 04, 2008, 07:40:07 PM »

Thanks for the info.

So the GCC 68k fd2pragma link is same as for MorphOS, meaning same fd2pragma commands ?

Is geek gadgets still the prefered programming suite for developing on OS3 ?

Or is geek gadgets to old ?

Where can I get latest GCC 4.3.2 for AmigaOS 3 ?

Can one simply compile GCC 4.3.2 source for Amiga ?

What are the issues involved ?

cheers
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Probably a very simple development question...
« Reply #8 on: November 05, 2008, 04:36:12 PM »
@asymetrix

Don't waste your time with the GCC 4.3.2 sources.  They only have a 68k code generator for embedded systems and would need you to adapt the Geek Gadgets binutils sources to run it at all.  I think the last GCC for 68k processors on the Amiga was version 3.4.0.  You can get it on the Back to the Roots website.  Look in the Geek Gadgets archive.
 

Offline Minuous

Re: Probably a very simple development question...
« Reply #9 on: July 15, 2010, 12:20:58 AM »
Quote from: asymetrix;425872
Is geek gadgets still the prefered programming suite for developing on OS3 ?


When was it ever?
 

Offline DBAlex

  • Sr. Member
  • ****
  • Join Date: Aug 2005
  • Posts: 304
    • Show only replies by DBAlex
Re: Probably a very simple development question...
« Reply #10 on: July 15, 2010, 01:26:02 AM »
Quote from: Minuous;570424
When was it ever?


Epic bump, amigo!
Machines:
- A1200, Blizzard 1260 w/ 64MB RAM, 1.2GB HD, PCMCIA WiFi, AGA w/ RGB Adapter, OS3.9
- Pegasos I, G3 600Mhz, 512MB, Radeon 9200se, 80GB HD, AmigaKit WiFi Card, MOS 1.4.5
- Mac Mini, G4 1.5ghz, 512MB (1GB Soon), Radeon 9200 64MB, 80GB HD, OSX 10.5 (Leopard)
- PCs, Laptops... *yawn*... :D