Error Messages /
Linker Errors
Error 42: Symbol Undefined
Many things could have caused this problem, but here are a few reasons and suggestion solutions. (This list is incomplete.)
You neglected to provide the linker with a needed binary file.
Example:
Command line:
![]() |
|
Linker output:
![]() |
|
Possible problem: The linker don't know where jic.obj is (note the jic in _D3jic6CallMeFAaZa and _D3jic9CallMeTooFAaZAa).
Solution: Add jic.obj or jic.d when invoking the compiler.
Try this
![]() |
|
![]() |
|
For a more detailed example: DsourceTopic:630
You're using a old .lib file (created from a .dll) that's missing some definitions
The Win32 libraries distributed with D are very old, from 1995-1996, so anything introduced in Windows 98 and upwards won't be available.
You can either call functions at runtime with GetProcAddress, or link them in at compile time. To do the latter, you need to create a new library file defining the function you wish to import, like so:
1) Create a new text file, called "user32ex.def", with the following content:
![]() |
|
![]() |
|
![](image/icon_world.gif)
![]() |
|
(source: NG:digitalmars.D.learn/1781)
Another way to fix this particular problem is to create an alternative .lib file with implib and a better .def file, such as one of those available at DsourceProject:bindings/wiki/DefFiles (
NG:digitalmars.D.learn/1786).
Yet another approach is to try using the linkdef tool on the .dll: http://www.dprogramming.com/linkdef.php.
Another tool (called "coffimplib") seems like a more direct approach. See NG:digitalmars.D.announce/2405.
You're using a library that suffers from OPTLINK's template linking bug.
See "Template Linker Problem" at DocComments/Template for an example and some suggestions.
You do not define the destructor, only give a prototype.
Example:
![]() |
|