从GitHub上下载 zip https://github.com/nanomsg/nanomsg 官方Readme.md中关于Windows的安装方法很简单,如果你完全照做可能编译后是一个32bit的nanomsg https://github.com/nanomsg/nanomsg/issues/859 有人提出了解决方法 : mkdir build cd build cmake -G "Visual Studio 14 Win64" .. # version 14 is mapped to Visual Studio 2015... cmake --build . --config Release # -DCMAKE_BUILD_TYPE=Release has no effect all here
注意这是 Visual Studio 14 下面是我的流程:
以Administrator权限打开 Visual Studio 17 下的 x64 Native Tools Command Prompt mkdir build cd build “c:\Program Files\CMake\bin\cmake.exe” -G “Visual Studio 15 Win64” .. “c:\Program Files\CMake\bin\cmake.exe” –build . –config Debug “c:\Program Files\CMake\bin\ctest.exe” -C Debug . “c:\Program Files\CMake\bin\cmake.exe” –build . –config Debug –target install
-- Install configuration: "Debug"
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/nn.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/inproc.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/ipc.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/tcp.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/ws.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/pair.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/pubsub.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/reqrep.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/pipeline.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/survey.h
-- Up -to-date: C :/Program Files /nanomsg/include /nanomsg/bus.h
-- Installing : C :/Program Files /nanomsg/bin/nanocat.exe
-- Installing : C :/Program Files /nanomsg/lib/pkgconfig/nanomsg.pc
-- Installing : C :/Program Files /nanomsg/lib/nanomsg.lib
-- Installing : C :/Program Files /nanomsg/bin/nanomsg.dll
-- Installing : C :/Program Files /nanomsg/lib/cmake/nanomsg/nanomsg-config.cmake
-- Installing : C :/Program Files /nanomsg/lib/cmake/nanomsg/nanomsg-config-debug.cmake
FinalizeBuildStatus:
Deleting file "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild".
Touching "x64\Debug\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
Done Building Project "C:\nanomsg-1.1.4\build\install.vcxproj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:12.59