问题
I've been tasked with compiling openldap for Windows, using Visual Studio. I am comfortable doing configure > make > make install in POSIX environments, but I have never used VS and am not sure how to even generate a useable makefile using what's in the openldap source tarball.
I have Visual C++ 10 Express installed on a Windows 7 box, and I've also installed MinGW to try to run the configure script, but I'm afraid that's going to then insert MinGW libraries, instead of whatever native Windows libs VC would use.
I would be grateful for any clues.
回答1:
The KDE guys have CMake-based build system for openldap. You could follow the instructions on http://techbase.kde.org/Getting_Started/Build/Windows/emerge to set up the build environment. The main steps would be something like:
mkdir c:\kdedev
cd c:\kdedev
git clone git://anongit.kde.org/emerge.git
mkdir etc
cp emerge\kdesettings-example.bat etc\kdesettings.bat
# edit kdesettings.bat to use msvc2010 compiler
emerge\kdeenv.bat
emerge openldap
This will build more than just openldap (it pulls in dependencies like cyrus-sasl and openssl). There are a number of patches that are applied for the KDE builds, that may or may not be relevant outside of the KDE environment.
But the nice thing is that CMake supports generating a Visual Studio project file, so you'd be able to generate that and do builds in VS.
回答2:
I would stop the bleeding right now and download the Windows port from here. I've been using it in production for over a year and nary a problem.
来源:https://stackoverflow.com/questions/10484788/compiling-openldap-using-visual-studio-10-express