0

I have correctly compiled Boost for Windows 8 with VS-10 as given in this link. My project works fine. But when I copy the project to another Windows 7 machine it returns an error message as "The application was unable to start correctly (0xc000007b). Click OK to close this application.". I have correctly installed Boost in the second PC as well. Both PCs are 64-bit and I installed 32-bit Boost in both. As I found from some links this is because the project try dynamically linking 64-bit libraries instead 32-bit. Could you kindly advice how to build this as a portable solution. Thanks in advance.

Update 1: Following is the dependency walker output. enter image description here

4

1 回答 1

1

您确定选择了 Visual Studio 2010 命令提示符 x86 来编译库吗?还是 x64 版本?开始菜单中有超过 1 个版本的命令提示符。我的猜测是你不小心运行了 x64 版本,然后用它编译了 boost,导致编译的库的 x64 位版本。

这是一个在 x86 中编译 boost 的静态和共享版本的批处理文件:

compileboost.bat:

call "%vs110comntools%..\..\VC\vcvarsall.bat" x86
cd C:/boostsourcefolder/
call bootstrap.bat
.\b2 runtime-link=static
.\b2 runtime-link=shared

然后在你的 VS2010 项目属性中,Common Properties -> VC++ Directories -> Include Directories,输入你的 boost 文件夹(C:/boostsourcefolder/)。并在 Common Properties -> VC++ Directories -> Library Directories 中,键入 boost 编译库文件夹 (C:/boostsourcefolder/stage/lib/)。

这几乎就是您需要做的所有事情。

于 2013-06-02T03:29:57.387 回答