slc@hoptoad.uucp (Steve Costa) (06/25/89)
I'm getting a message from BLink that I don't understand. my code includes the following: ... #include <graphics/layers.h> ... extern struct LayersBase *LayersBase; ... LayersBase= (struct LayersBase *) OpenLibrary ("layers.library",0); if (LayersBase == NULL) exit (FALSE); ... if(LayersBase)CloseLibrary(LayersBase); ... But linking returns the following message: ... Undefined symbols First Referenced _LayersBase File 'Wrk:DJFonts.o' Enter a DEFINE value for _LayersBase (default _stub): ... I'm having no problems with other libraries. What gives with layers? And what is it talking about with "(default _stub)"? I assume that I'm missing some #define statement somewhere, but I haven't a clue, even after searching through the include files. Any help would be greatly appreciated.
slc@hoptoad.uucp (Steve Costa) (06/25/89)
In article <7760@hoptoad.uucp> slc@hoptoad.UUCP (Steve Costa) writes: > >I'm getting a message from BLink that I don't understand. >my code includes the following: >... >#include <graphics/layers.h> >... >extern struct LayersBase *LayersBase; >... >But linking returns the following message: >... >Undefined symbols First Referenced >_LayersBase File 'Wrk:DJFonts.o' >Enter a DEFINE value for _LayersBase (default _stub): >... >I'm having no problems with other libraries. What gives with layers? >And what is it talking about with "(default _stub)"? > > > Costa's corollary to Murphy's Law: Obvious answers to simply problems come only when you embarrass yourself by asking dumb questions. (and get a good night's sleep). I shouldn't have declared "LayersBase" as extern! So when BLink said it wasn't defined, it meant exactly that. Although it would have been nice if all of the library bases had been treated the same way. My humble apologies for wasting your time.
prem@geomag.fsu.edu (Prem Subramanyan) (06/26/89)
Ah, good ol' blink. I have recently run into problems with it myself. after careful search through the documentation, I discovered in very fine print, the necessary correction. I doubt that the problem is in your code, but in the linkage. _stub is the name that blink wants to give to every function that is not defined, allowing development of code sans functions and then adding in the functions later. What you need to do is blink the following way. blink from lib:c.o,{other files} to {executable} lib {libraries} the important part to include is the lib:c.o at the beginning of the link. Heck, I had problems with lc.lib until I added the c.o part at the beginning. After adding c.o, the files linked correctly. For a while, blink really had me going. I followed its advice and re-compiled all of my modules with the option -b0, which took incredibly long as my machine only has 512K, forcing me to put quad files to disk. So, after several hours of compiling and re-compiling, I looked again at the linking docs in the compiler usage section of the manual (not the command section as the docs on blink did not tell me about c.o there) and found this solution. I hope this will be of help--Happy Compiling..... --- Prem Subrahmanyam