English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 29 March 2016, 17:22   #1
cmsj
Registered User
 
cmsj's Avatar
 
Join Date: Feb 2016
Location: London / UK
Posts: 166
Linking errors with CardResource

Hey all

I'm trying to write a little program to interact with PCMCIA cards (really, just query them for information) and I've run into an odd issue.

Whether I use SAS/C or ADE's gcc, or an m68k gcc cross compiling toolchain on Linux, I'm getting a linker error relating to the CardResource symbol being undefined.

I'm not sure what I should be linking to define it, but at least in the case of both gcc's, the symbol is defined in libamiga.lib that gets linked.

I've pushed up the code to https://github.com/cmsj/cardInfo and in its current form it should compile with GCC, it just won't link.

Am I missing something really stupid here?
cmsj is offline  
Old 29 March 2016, 17:51   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,002
Change

Code:
APTR cardRes;
into

Code:
struct Library *CardResource;
then the linker should be happy.

You also have to ReleaseCard() at the end of your program.
thomas is offline  
Old 29 March 2016, 19:13   #3
cmsj
Registered User
 
cmsj's Avatar
 
Join Date: Feb 2016
Location: London / UK
Posts: 166
Quote:
Originally Posted by thomas View Post
Change

Code:
APTR cardRes;
into

Code:
struct Library *CardResource;
then the linker should be happy.
Aha! Thank you

I was hunting all over the place for someone else to be supplying that symbol, it hadn't occurred to me that *I* had to provide it
cmsj is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking errors with vbcc when not using C99 tygre Coders. C/C++ 5 25 December 2015 21:01
Linking problem arti Coders. C/C++ 2 23 January 2015 19:03
what cable do i need for linking two amigas? trydowave support.Hardware 11 13 July 2013 14:35
Devpac Linking Problems Steve Coders. General 8 10 December 2002 11:37

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:21.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06903 seconds with 15 queries