The project was build using Microsoft Visual Studio Enterprise 2015 version
14.0.25431.01 Update 3 on 64-bit windows 10 machine for 32-bit Excel, which
is part of Microsoft Office Professional Plus 2013 (Excel
information can be found in File> Account> About Excel).
Visual Studio Project Parameters (The project path C:\Projects\vs\ should be modified accordingly. Check also the path to java lib folder and Windows SDK libraries folder on your machine and set them accordingly).
The project was rebuild using Visual Studio 15 with the following configuration parameters (Debug> Xlloopkr properties):
General
Other settings
Differences from the original XLLoop project
Definitions
Typical project errors
Below is the list of typical error that were encounted during the project build stage.
Visual Studio Project Parameters (The project path C:\Projects\vs\ should be modified accordingly. Check also the path to java lib folder and Windows SDK libraries folder on your machine and set them accordingly).
The project was rebuild using Visual Studio 15 with the following configuration parameters (Debug> Xlloopkr properties):
General
- Debug/Release: x86. (Note that the project can also be built using x64 option but the produced xll file will not be recognized by Excel as a proper excel addin library).
- Platform: win32. If x64 platform is selected, the produced addin was recognized by Excel on local machine but not when copied to other machines. (Note that the Linker> Input> Additional Dependencies xlcall32.lib library switches automaically to xlcall32-x64.lib library version, if x64 platform is selected, and switched back to xlcall32-x86.lib version if win32 option is selected. Check that the correct library version is selected).
- General> Target Platform Version 8.1
- General> Target Extension: .xll
- General> Platform Toolset: Visual Studio 2015 (v140)
- General> Configuration Type: Dynamic Library (.dll)
- General> Character Set: Not Set
- VC++ Directores> Include Directories: C:\Program Files\Java\jdk1.8.0_40\include; C:\Program Files\Java\jdk1.8.0_40\include\win32;
- VC++ Directores> Library Directories: C:\Projects\vs\Xlloopkr-1.0.0\lib; C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64;
- Code Generation> Runtime Library: Multi-threaded (/MT). If Multi-threaded DLL (/MD) option is selected, a smaller xll Excel library is produced that is recognized on the machine where it was build but not recognized when copied to other machines.
- General> Additional Library Directories: C:\Projects\vs\Xlloopkr-1.0.0\lib;
- Input> Additional Dependencies: xlcall32-x86.lib;wsock32.lib;winhttp.lib. The xlcall32-x86.lib will switch automaticall to xlcall32-x64.lib if x64 platform option is selected (and back to xlcall32-x86.lib if win32 platform is selected).
- Input> Module Definition File (not necessary): C:\Projects\vs\Xlloopkr-1.0.0\Xlloopkr\src\Xlloopkr.def. This is not a required option since all exported functions are declared in the Xlloopkt.cpp file. The VS builder will throw a set of warnings that the functions are exported multiple times if the definition file is also included in the xll output. (Note that an .xll excel library file is a .dll library file that must export a specific set of functions at least once to be recognized by Excel as a proper addin file).
- C:\Projects\vs\Xlloopkr-1.0.0\lib\: xlcall32-x86.lib and xlcall32-x64.lib. This is x86 and x64 versions of the xlcall32 library obtained from Excel 2013 SDK: Excel 2013 XLL Software Development Kit and is discussed in xlloop notes).
Other settings
- Add C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64 to the PATH variable (so that VS could find rc.exe file to build the project
- Add (if necessary) Microsot Foundation Classes (Control Panel-> Programs and Features->Microsoft Visual Studio-> Change->Modify-> Add Microsoft Foundation Classes)
Differences from the original XLLoop project
- yajl library source files were added directly to the project and compiled with the project. In the original project the library was added as external library (and shall be recompiled for the new project);
- msvcrt.lib library is not added directly to the project library (this may be the reason why the MD compiler option failes to create the library recognized on machines other than machine where it was built).
Definitions
- Multi-threaded (/MT): Defines _MT so that multithread-specific versions of the run-time routines are selected from the standard header (.H) files. This option also causes the compiler to place the library name LIBCMT.LIB into the .OBJ file so that the linker will use LIBCMT.LIB to resolve external symbols. Either /MT or /MD (or their debug equivalents /MTd or /MDd) is required to create multithreaded programs. For more information see MSDN compiler options and CRT librray features.
- Multi-threaded DLL (/MD): Defines _MT and _DLL so that both multithread- and DLL-specific versions of the run-time routines are selected from the standard .H files. This option also causes the compiler to place the library name MSVCRT.LIB into the .OBJ file. Applications compiled with this option are statically linked to MSVCRT.LIB. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCRT.DLL, which must be available at run time to applications linked with MSVCRT.LIB
Typical project errors
Below is the list of typical error that were encounted during the project build stage.
- Addin not recognized by Excel. The project can often build correctly
but Excel will not recognize it as addin and will show the following message:
"The file format and extension of .xll don't match. The file could be corrupted
or unsafe. Unless you trust its source don't open it. Do you want to open it anyway".
The following project setup parameters may fix the problems:
- Debug/Release: x86. With the x64 configuration parameter, the problem was present on both local and other machines.
- Platform: win32. With the x64 option the build .xll file was recognized on the local machine (where the library was built) but not on other machines where it was copied.
- Runtime Library: Multi-threaded (/MT). With the Multi-threaded DLL (/MD) option the build .xll file was recognized on the local machine (where the library was built) but not on other machines where it was copied.
- Unresolved symbols Excel4 and Excel4v. The problem is typically present whenever the builder cannot find the xlcall32.lib library. Check that the path to additional libraries is set correctly, xlcall32.lib was added to the library folder, and the library was generated as described in xlloop notes. Use the x86 version of the xlcall32.lib library when the project is built using x86 platform.
- Other unresolved symbols. The problem can often be caused by the project failing to find the related system library. In this case you need to identify the missing library and add it to Linker> Input> Additional Dependencies list. This is the reason the parameter includes references to wsock32.lib and winhttp.lib system libraries. For example, "LNK2001: unresolved external symbol _imp_WinHttpConnect" error message is thrown because the VS project builder failed to include the winhttp.lib library (which is a part of the Windows SDK and therefore it is sufficient to make a reference to it without including it in the project library folder).