CompuServe Thread

#hunk files

4 messages in this thread
#42945From: Supra CorpOct 4, 1994 10:38 AM
Hello again..C question… I used bin2hunk 2.2 to create a data hunk file. The data name is _data and the hunk name defaulted to __MERGED. In the program I defined data as extern __far _data[]; after compiling the program I attempt to link the two together and when I do is comes back and asks me for a value for _data… What am I doing wrong? Alex
#42946From: Werner KazmierzakOct 4, 1994 6:01 PM
Alex, smply try to use extern char data[]; in your C code. The underscore will automatically be added to variables defined in C. Furthermore I think (but maybe I'm wrong here), variables in a hunk named __MERGED dont't need to be declared as __far, because they will be accessed as word offsets relative to __LIKERDB, which is the start address of this hunk and will be loaded into register A4 by C startup code. – wkc – … via AP from Hamburg, Germany
#42978From: Supra CorpOct 6, 1994 3:02 PM
I'll give it a try.. Alex
#43120From: Doug WalkerOct 14, 1994 5:36 PM
Hi Alex – You declare the variable "extern", but do you ever DEFINE the variable? If you don't, that would explain why it's coming up undefined. You need to have it in at least one file without the "extern" keyword. In that file, you'll need to have a number inside the [] or you'll need to give it some initializer data (which allows the compiler to infer the number of elements.) –Doug