After adding a new source file or library to an XLL+ project and saving the project, the following linker error occurs:
LNK2005: symbol multiply defined
In particular, this can occur in a project which previously linked perfectly.
Determine the name of the appropriate XLL+ run-time library, using the list below. In the Link / Input page of the Project Settings dialog, put the name of the library at the start of the Additional Dependencies field. Note that you will need to do this for both configurations, Debug and Release, and that each configuration will use a different library.
In the Additional Dependencies field add the required libraries at the beginning (i.e. left-hand side) of the list. The required libraries are as follows. Ensure that you select the correct libraries for the builds you are using.
Build | Configuration | Character set | Library |
---|---|---|---|
MFC | Debug | ANSI | xlllibd.lib |
MFC | Release | ANSI | xlllibr.lib |
MFC | Debug | Unicode | xlllibdw.lib |
MFC | Release | Unicode | xlllibrw.lib |
STL | Debug | ANSI | xlllibsd.lib |
STL | Release | ANSI | xlllibsr.lib |
STL | Debug | Unicode | xlllibsdw.lib |
STL | Release | Unicode | xlllibsrw.lib |