1

I am generating rocketmq dll from rocketmq-cpp opensource github Project.I have used folling Prequisite boost 1.56.0,--> have build using this jam.exe msvc architecture=x86 address-model=64 link=static runtime-link=static stage(which is 64 bit builded) Cmake 3.9.3 so,i have build rocketmq-cpp using cmake -G "Visual Studio 15 2017" it will generate Project but whenEver i am building project it always shows Error libboost_thread-vc140-mt-s-1_56.lib(thread.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' But when i have changed boost 1.56.0 to build using 32 bit after that i am getting Error fatal error LNK1112 libboost_atomic-vc120-mt-1_58 not found .i am not able to find how visual studio searching for libboost_atomic-vc120-mt-1_58 which is not there in boost 1.56.0/stage/lib.i have used

Vikas Singh
  • 181
  • 7

1 Answers1

0

Considering that you have boost 1.56.0 built as a 64-bit library, when building rocketmq-cpp, you have to make sure to also use the 64-bit generator for Visual Studio. After clearing you existing build directory, try using cmake -G "Visual Studio 15 2017 Win64" (note the Win64 prefix)

See https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html

J-Christophe
  • 1,975
  • 15
  • 13
  • I have tried your solution but whenEver its building from visualstudio it always getting this Error LINK : fatal error LNK1104: cannot open file 'libboost_atomic-vc120-mt-s-1_56.lib' since i have libboost_atomic-vc140-mt-s-1_56 in boost/stage/lib i dont know whey visual studio searching for wrong libs – Vikas Singh Aug 08 '18 at 08:07
  • Could you confirm you built the boost libraries using VS2017 and not VS2013 ? In other word, before running `jam.exe` which visual studio terminal did you open ? Updating your post indicating how boost is built would be helpful too. (all steps from checking the source, to configuring and build should probably be listed) – J-Christophe Aug 08 '18 at 15:57
  • build and install boost 1.56.0,following build options are needed to be set when run in VisualStudio Developer 2017 bjam.exe: msvc architecture=x86 address-model=64 link=static runtime-link=static stage after builded /stage/lib/*.lib files Navigate to rocketmq-cpp build in visual studio 2017 developer Command cmake -G "Visual Studio 15 2017 Win64" .. Then open Build Project in visual studio 2017 and build the PRoject it giveserror LNK1104: cannot open file 'libboost_atomic-vc120-mt-s-1_56.lib' – Vikas Singh Aug 09 '18 at 04:56