PRB: The XLL+ 64-bit build fails in Visual Studio 2015 with Error C1189
Reference: Q0058
Article last modified on 30-Jul-2016
The information in this article applies to:
- XLL+ for Visual Studio 2015 - 7.0.7
64-bit builds of XLL+ projects created using Visual Studio 2015 fail with compile error C1189
Issue
After I create a new XLL+ project with XLL+ 7.0.7 under Visual Studio 2015, the 64-bit platform fails to build with error:
Error C1189 #error: include 'stdafx.h' before including this file for PCH
Summary
There is a fault in the project creation script in XLL+ 7.0.7 for Visual Studio 2015.
Solution
This fault was fixed in version 7.0.8, and therefore the easiest solution is to upgrade to XLL+ 7.0.8 for Visual Studio 2015, and then to run the XLL+ Upgrade Wizard.
Work-around
To work around the problem you need to:
- Replace the faulty 64-bit platform settings by deleting them and then cloning the x86 platform settings.
- For each build, set ForceSymbolReferences to DllMain.
Detailed steps
1. Remove the faulty 64-bit Solution settings
- Click on the menu command: Build / Configuration Manager.
- In the Configuration Manager dialog, click on the "Active solution platform" combo-box and select "<Edit...>"
- In the Edit Solution Platforms dialog, select "x64" in the list, and press the "Remove" button.
- Click "Yes" in the confirmation dialog.
- Click "Close" in the Edit Solution Platforms dialog.
2. Remove the faulty 64-bit Project settings
- Still in the Configuration Manager dialog, in the projects grid, drop down on the "Platform" combo box in the first row, and select "<Edit...>".
- In the Edit Project Platforms dialog, select "x64" in the list, and press the "Remove" button.
- Click "Yes" in the confirmation dialog.
- Click "Close" in the Edit Project Platforms dialog.
3. Create new 64-bit settings
- Still in the Configuration Manager dialog, click on the "Active solution platform" combo-box and select "<New...>".
- In the New Solution Platform dialog, select "x64" in the list for the new platform, set "Copy settings from:" to "x86", put a check against "Create new project platforms" and press the "OK" button.
- In the Configuration Manager dialog, click on the "Active solution platform" combo-box and select "x64".
- Close the Configuration Manager dialog.
4. Fix the link settings
- Use the Project / Properties menu command to open the Project Property Pages window.
- Set Configuration to "All Configurations" and ensure that Platform is set to "x64".
- In the left hand side tree, select the node: "Configuration Properties / Linker / Input". Force Symbol References will contain _DllMain%4012;%(ForceSymbolReferences). Change it to DllMain;%(ForceSymbolReferences).
The 64-bit platform settings are now complete, and you will be able to build both Release and Debug.