1

Let's say we have an application that will need Boost to compile. Boost being an external library, updated regularly, and our application having multiple binaries and multiple versions ("multiple" as in "Let them grow and multiply"... don't ask...), we need an easy to update/maintain indirection to have for each app's version link with the right Boost version.

For example:

  • MyApp 8.0 => Boost 1.34
  • MyApp 8.1 => Boost 1.35
  • MyApp 9.0 => Boost 1.35
  • MyApp 10.0 => Boost 1.37

On a Linux filesystem, we would create a symbolic link redirecting to the right boost directory:

  • MyApp 8.0 => MyAppBoostLink_8.0 => Boost 1.34
  • MyApp 8.1 => MyAppBoostLink_8.1 => Boost 1.35
  • MyApp 9.0 => MyAppBoostLink_9.0 => Boost 1.35
  • MyApp 10.0 => MyAppBoostLink_10.0 => Boost 1.37

This would enable us to easily update MyApp 10.0 to link with Boost 1.38 when it will be available, just by replacing the symbolic link.

But on Windows, this does not work (or I missed something).

Boost itself seems to give up on the idea: With BJam, I recall seeing warnings saying BJam was copying the lib files because symbolic links did not work on WinNT. I tried an alternative, as we use Visual C++, but no pragma resolves this problem (I searched for a pragma adding default search directories for header includes and library links, but found none).

I can't believe I'll need to launch a script to check-out the VCPROJs files (Visual C++ XML makefiles), to update the Boost includes, and then check-in the modifications, but I see no other solution until Windows have working symbolic links (or either I discover how to create them).

Is there a better idea?

Edit

The problem disappeared when we updated our compiler, from Visual C++ 2003 to Visual C++ 2008. Apparently, Visual C++ 2008 sees symbolic links across networks.

4

2 回答 2

3

在 NTFS 文件系统上等效的 Windows 符号链接称为连接:http ://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

于 2009-01-26T12:49:07.620 回答
2

您可以将 boost 安装的基本目录保存在特定于版本的环境变量中,该环境变量在 VS2008 的“启动批处理文件”中设置。这可能不像在构建过程中必须操作 .vcproj 文件那么难看。大概...

于 2009-01-26T12:56:06.793 回答