最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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 Is Configuration Type set to DLL? As here: i.sstatic/yCb7R.png – Renat Commented Jan 29 at 22:13
  • 1 Thanks, Renat - good call. I had created a new configuration and didn't copy the old (Win32) configuration. So I corrected that and the config type is set to dll again. I have other problems now, LNK2001 and LNK2019 but yes the LNK1561 error has gone away so I will say this is the accepted solution. It's probably to clunky to revise the OP question. – Valarenti Commented Jan 29 at 22:42
  • regarding LNK2001, it seems worth to search for xlAutoOpen (and xlAutoClose, xlAutoAdd, xlAutoRemove) function, supposed to be exported by XLL, and if they have XLL_X32 near them try to change to XLL_X64 (found in random XLL 32-bit example on Github – Renat Commented Jan 29 at 23:12
  • And also ensure that xcall**.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
  • I've rolled back your edit. You cannot substantially alter the question after you've received answers to it, as it invalidates those answers. If you're now having a different problem, use the Ask Question button to ask it. Before doing so, I strongly suggest that you search for LNK2001 on this site, as the question has been asked and answered multiple times, so asking another one will just result in closure as a duplicate. – Ken White Commented Jan 29 at 23:29
Add a comment  | 

1 Answer 1

Reset to default 1

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:

发布评论

评论列表(0)

  1. 暂无评论