C-API Development for Domino 9 64bit
Daniel Nashed – 25 October 2013 07:21:00
The following is a short info for all C-API developers who want to port their applications to native 64bit on Windows.
It took me some time to find the right Microsoft compiler and that's why I want to give you a quick summary.
This can save you some of time and frustation. Once you installed the wrong compiler or did the wrong update you might not be able to re-install the compiler.
I had to switch to a new Windows 2008 R2 VM and re-installed everything from scratch after things went wrong.
The following is the straight way to get your development platform up and running.
-- Daniel
Introduction and History
Since Domino 8.5.x Domino is also available as native 64bit application.
When it shipped the Microsoft 64bit compiler wasn't in a shape that IBM could use it to port Domino to Windows64.
They hat to switch to the Intel compiler in combination with header files from the Microsoft compiler.
The Intel compiler was quite expensive and it wasn't easy to get the right version because it is not the most current Intel compiler.
Notes/Domino 8.5.x
IntelĀ® C++ Compiler for Windows version 9.1
Note: IntelĀ® C++ Compiler for Windows version 9.1 is the only supported compiler.
It works on top of SDK of Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for AMD64.
C API 64bits users need to install Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for AMD64 as well.
Starting with Domino 9 the compiler switched back to the Microsoft compiler. Which is really great news!
The compiler used is the Visual Studio 2010 compiler.
Notes/Domino 9.0
You can develop 32-bit programs for all supported Windows 32-bit platforms using Microsoft Visual Studio 2010 SP1 for Windows.
You can develop 64-bit programs for all supported Windows 64-bit platforms using Microsoft Visual Studio 2010 SP1 for Windows.
What you need to install
There are different packages available. What you would normally install is the "Visual Studio Express 2010".
But that does not come with 64bit support for whatever reason. You have to install the Microsoft Windows SDK on top of it and create some batch files that configures your environment if you want to use makefiles.
It tuned out that if you install Visual Studio Express 2010 SP1 on top of this combination the 64bit option does not work any more.
Also the SDK brings it's own installation of Visual Studio 2010 SP1 Standard for x86 and x64.
For the Express version you still have to request a license key. For the SDK no license key is required.
So what you should install is the SDK instead of the compiler and that brings the compiler along.
The next important part is that you should not install the compiler service pack. Instead there is a service pack for the SDK itself, which includes the service pack for the compiler.
That brings you to the right compiler and build level for C-API development with Domino 9 :-)
Here are the two links that you need to install the SDK and SP1.
It's the newer SDK which supports also Windows 7.
But you can bring it into Win2008 "mode".
-- snip --
Microsoft Windows SDK for Windows 7 and .NET Framework 4
http://www.microsoft.com/en-us/download/details.aspx?id=8279
Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1
http://www.microsoft.com/en-us/download/details.aspx?id=4422
Install this update to restore the Visual C++ compilers and libraries that may have been removed when Visual Studio 2010 Service Pack 1 (SP1) was installed.
The compilers and libraries are part of the Microsoft Windows Software Development Kit for Windows 7 and the .NET Framework 4 (later referred to as the Windows SDK 7.1).
-- snip --
Configuration of your Environment
Once you have installed the compiler you need to configure the 64bit environment.
By default the x64 does not work because the batch file you need is not installed. The compiler is installed correctly but the cmd file to setup the environment is missing.
The cmd file will report
The specified configuration type is missing. The tools for the configuration might not be installed.
The workaround is to create the file vcvars64.bat which will invoke the setenv.cmd file.
But the best way is to invoke setenv.cmd directly and not use the vcvarsall.bat x64 option.
This also gives you more granular options.
My configuration for 64bit looks like this -- assuming the C-API toolkit is installed in c:\notesapi.
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\setenv.cmd" /Release /x64 /2008
set lib=c:\notesapi\lib\mswin64;%lib%
set Include=c:\notesapi\include;%include%
Once you have setup your environment you can start compiling the included sample applications.
They will compile and run if you setup the environment correctly.
Afterwards you have a lot of fun looking into the sample makefiles which use the original makefile options with all the fancy switches from building Domino (also shipped with the toolkit in the cmp directory for all platforms).
I went thru all the options and checked them to see what makes sense to change in my makefiles (compared to the makefiles for the older Microsoft compiler and the Intel compiler).
This might take some time but you just might saved at least half a day getting your your compiler up and running ;-)
Also generation of sym files is not supported any more with Domino 9 and 64bit. You have to switch to PDB files.
But that is something where I need to sort our some details and will blog about it once everything is sorted out.
I have it working in my environment but I have to check with IBM for some details.
- Comments [7]