不能在Windows服务应用程序中包含某些boost头

cannot include some boost header in windows service application

本文关键字:包含某 boost 应用程序 Windows 服务 不能      更新时间:2023-10-16

开发环境:

  • 操作系统:Windows 8
  • IDE: Visual Studio 2010
  • Boost Version: 1.55.0

我有一个简单的应用程序,它将字符串写入文件。因为我必须运行应用程序作为windows服务,我使用windows服务api,如StartServiceCtrlDispatcher, RegisterServiceCtrlHandler等。这样一切都很好,生活也很好。但是当我在代码中包含boost头时,我有问题从net start命令启动服务。包括这个

#include <boost/filesystem.hpp>

这是我得到的错误

C:WINDOWSsystem32>net start aab
The service is not responding to the control function.
More help is available by typing NET HELPMSG 2186. 

我使用sc create aab binpath="path to executable"来创建服务

我不知道boost是如何干扰的,也不知道如何调试它或找到解决方案。

似乎与boost的使用没有什么关系。

binpath=""看起来很奇怪。如果没有二进制文件,你怎么能指望服务启动呢?

另外,如果在实际测试中这实际上是可以的,

  • 检查dll依赖项(dependencywalker.com)