Search code examples
exceladd-inxll

Converting 32-bit xll Excel add-in to 64 bit: LNK1561 error


I've inherited an ancient C project that builds an Excel add-in .xll file which works with 32-bit Office, but not 64-bit Office. The project is in a Visual Studio 2022 solution. There are two folders included in the solution which are included as "Additional Library Directories" in the Project's Configuration Properties (the only change I've made is to set the Platform from Win32 to x64. The project compiles with no errors when the Platform is Win32. When I change the platform to x64 and Rebuild, I get the error

LNK1561 entry point must be defined

in file LINK line 1.

Any ideas would be greatly appreciated.


Solution

  • This answer was based on the original question asked, which was then altered by the OP to ask about different issues.

    As per error help page from Microsoft:

    Linker Tools Error LNK1561

    The linker did not find an entry point, the initial function to call in your executable. By default, the linker looks for a main or wmain function for a console app, a WinMain or wWinMain function for a Windows app, or DllMain for a DLL that requires initialization. You can specify another function by using the /ENTRY linker option.

    This error can have several causes:

    • ...
    • You may not have specified the /DLL option when building a DLL.

    As XLL Excel add-in is a DLL loaded by Excel, it's worth to ensure that Configuration Type of a project is set to DLL:

    enter image description here