错误提示:
[color=red]mongoclient.lib(dbclient.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'[/color]
前提是:利用scons从mongodb的源码中编译mongoclient.lib, 版本为v2.0.0
通过scons编译出来的mongoclient.lib 在实际使用中发生如下错误:
mongoclient.lib(dbclient.obj) : fatal error LNK1112: module machine
type 'x64' conflicts with target machine type 'X86'
其中:命令行:> set
其中有一行为:
[quote]
[color=red]PROCESSOR_ARCHITECTURE=AMD64[/color]
[/quote]
主要原因是调用scons的命令行窗口参数不对,环境为amd64,所以可以做如下调整:
调用vs2010目录下自带的x86命令行窗口:
Microsoft visual studio 2010\Visual studio tools\Visual studio Command prompt
[quote]
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
[/quote]
然后调用
[quote]E:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>set PROCESSOR_ARCHITECTURE=x86[/quote]
再运行scons命令行就解决了。
[color=red]mongoclient.lib(dbclient.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'[/color]
前提是:利用scons从mongodb的源码中编译mongoclient.lib, 版本为v2.0.0
通过scons编译出来的mongoclient.lib 在实际使用中发生如下错误:
mongoclient.lib(dbclient.obj) : fatal error LNK1112: module machine
type 'x64' conflicts with target machine type 'X86'
其中:命令行:> set
其中有一行为:
[quote]
[color=red]PROCESSOR_ARCHITECTURE=AMD64[/color]
[/quote]
主要原因是调用scons的命令行窗口参数不对,环境为amd64,所以可以做如下调整:
调用vs2010目录下自带的x86命令行窗口:
Microsoft visual studio 2010\Visual studio tools\Visual studio Command prompt
[quote]
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
[/quote]
然后调用
[quote]E:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>set PROCESSOR_ARCHITECTURE=x86[/quote]
再运行scons命令行就解决了。