如何获取 split_winmain 的句柄
我正在尝试让 boost 库 program_options
在一个简单的 Windows 控制台库上工作。 我已经在图书馆链接了 C:\Program Files\boost\boost_1_40\lib\libboost_program_options-vc90-s-1_40.lib 包括定义的头文件
#include <boost/program_options.hpp>
#include <boost/program_options/config.hpp>
#include <boost/program_options/option.hpp>
#include <boost/program_options/detail/cmdline.hpp>
#include <boost/program_options/detail/parsers.hpp >
_WIN32
(但我不认为这是必需的。)
而且我仍然不断得到它
Error 1 error C3861: 'split_winmain': identifier not found
应该如此简单,但我无法让它工作。谁能告诉我我需要在这里做什么。 约瑟夫·沙纳汉
I am trying to get a get the boost library program_options
working on a simple windows console library.
I have linked in the libraryC:\Program Files\boost\boost_1_40\lib\libboost_program_options-vc90-s-1_40.lib
Included the header files
#include <boost/program_options.hpp>
#include <boost/program_options/config.hpp>
#include <boost/program_options/option.hpp>
#include <boost/program_options/detail/cmdline.hpp>
#include <boost/program_options/detail/parsers.hpp >
Defined _WIN32
(But I don't think it is required.)
And I still keep getting the
Error 1 error C3861: 'split_winmain': identifier not found
It should be so simple but I can't get it to work. Can anyone tell me what I need to do here.
Joseph Shanahan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该函数在
boost::program_options
命名空间中声明。如果您所做的只是单独使用其名称,则编译器不知道您在说什么。您有几个选择:调用时使用完全限定名称:
告诉编译器您指的是哪个函数:
将整个命名空间带入当前作用域:
创建命名空间别名:
我更喜欢最后一个。
不要定义
_WIN32
宏;编译器会在适当的时候为你做这件事。That function is declared in the
boost::program_options
namespace. If all you do is use its name alone, the compiler doesn't know what you're talking about. You have a few options:Use the fully qualified name when you call it:
Tell the compiler which function you mean:
Bring the entire namespace into the current scope:
Make a namespace alias:
I prefer the last one.
Do not define the
_WIN32
macro; the compiler will do that for you when it's appropriate.