Fixing "unresolved external" errors
If you work in multi-DLL apps, chances are you'll eventually hit one or more "unresolved external" errors. For that to happen you need to have some code or data with the ,EXTERNAL attribute. The help has this to say about EXTERNAL:
The EXTERNAL attribute specifies the variable, FILE, QUEUE, GROUP, or CLASS on which it is placed is defined in an external library. Therefore, a variable, FILE, QUEUE, GROUP, or CLASS with the EXTERNAL attribute is declared and may be referenced in the Clarion code, but is not allocated memory--the memory for the variable, FILE, QUEUE, GROUP, or CLASS is allocated by the external library. This allows the Clarion program access to any variable, FILE, QUEUE, GROUP, or CLASS declared as public in external libraries.Â
An unresolved external error is a linker error - after compiling your source the linker needs to find your external data declarations in another library, usually a DLL But the linker doesn't directly associate your code with the DLL itself. Instead it links in a LIB file for that DLL; it's the LIB that contains information on where the variables are located in the DLL.Â
If you have unresolved external errors, and you don't know which LIB to include in your project, you can always do a text search of all the LIB files you have for any of the missing symbols. But if the symbols are in one of your own apps a search of all of the export (.EXP) files will probably give you a more readable result. (And if the symbol is in the EXP but not in the LIB you need to recompile that DLL!)
Two search utilities I use on a regular basis are Keystone Source Search (KSS) and Windows Grep. KSS is far and away the more powerful option for most Clarion source searching, but as I usually have a DOS window open somewhere I still use grep on a regular basis for quick searches.Â