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.
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.
Share Improve this question edited Jan 29 at 23:30 Ken White 126k15 gold badges236 silver badges464 bronze badges asked Jan 29 at 21:46 ValarentiValarenti 3291 gold badge4 silver badges15 bronze badges 5 |1 Answer
Reset to default 1This 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:
xlAutoOpen
(andxlAutoClose
,xlAutoAdd
,xlAutoRemove
) function, supposed to be exported by XLL, and if they haveXLL_X32
near them try to change toXLL_X64
(found in random XLL 32-bit example on Github – Renat Commented Jan 29 at 23:12xcall**.lib
is specified in Additional Dependencies of linker, and it is in folder specified in Additional Library Directories. Like here: i.sstatic/V0vE5Qnt.png – Renat Commented Jan 29 at 23:26