【发布时间】:2011-05-15 00:18:47
【问题描述】:
我试图为 lighttpd 创建自己的模块,几分钟后我发现这一切都在 c 中!我需要地图和我用 C++ 制作的其他一些类。所以我遇到了http://redmine.lighttpd.net/wiki/lighttpd/CppModules 和http://redmine.lighttpd.net/wiki/lighttpd/CppHelperClasses 有(用于 lighttpd-cpp)一个 mercurial 项目,这里写了一些演示模块,但没有解释如何在 lighttpd 环境中编译和集成这些。这些也在/src/ 目录未编译(显然,所有依赖项都丢失了..
src]# cpp mod_blank.cpp -o a
In file included from mod_blank.cpp:5:
mod_blank.hpp:5:35: error: lighttpd-cpp/plugin.hpp: No such file or directory
mod_blank.hpp:7:30: error: boost/mpl/list.hpp: No such file or directory
有人知道吗?类似的经验或其他方式使用 c++ 做一个客户模块?
更新
感谢messa,我已经安装了scons,尝试编译,我得到了这些错误
./include/lighttpd-cpp/datatype_helpers.hpp:86: error: invalid conversion from 'long unsigned int' to 'config_values_type_t'
./include/lighttpd-cpp/datatype_helpers.hpp: In instantiation of 'const config_values_type_t config_option_traits_base<short int, 2ul>::value_enum':
./include/lighttpd-cpp/datatype_helpers.hpp:347: instantiated from 'handler_t config_option<OptionType, ConfigScopeType, OptionTraits>::set_defaults(const server&) [with OptionType = short int, long unsigned int ConfigScopeType = 2ul, OptionTraits = config_option_traits<short int>]'
src/mod_blank.cpp:6: instantiated from here
./include/lighttpd-cpp/datatype_helpers.hpp:243: error: uninitialized const 'config_option_traits_base<short int, 2ul>::value_enum'
./include/lighttpd-cpp/datatype_helpers.hpp: In instantiation of 'const config_values_type_t config_option_traits_base<bool, 4ul>::value_enum':
./include/lighttpd-cpp/datatype_helpers.hpp:347: instantiated from 'handler_t config_option<OptionType, ConfigScopeType, OptionTraits>::set_defaults(const server&) [with OptionType = bool, long unsigned int ConfigScopeType = 2ul, OptionTraits = config_option_traits<bool>]'
src/mod_blank.cpp:6: instantiated from here
./include/lighttpd-cpp/datatype_helpers.hpp:243: error: uninitialized const 'config_option_traits_base<bool, 4ul>::value_enum'
./include/lighttpd-cpp/datatype_helpers.hpp: In instantiation of 'const config_values_type_t config_option_traits_base<int, 3ul>::value_enum':
./include/lighttpd-cpp/datatype_helpers.hpp:347: instantiated from 'handler_t config_option<OptionType, ConfigScopeType, OptionTraits>::set_defaults(const server&) [with OptionType = int, long unsigned int ConfigScopeType = 2ul, OptionTraits = config_option_traits<int>]'
src/mod_blank.cpp:6: instantiated from here
./include/lighttpd-cpp/datatype_helpers.hpp:243: error: uninitialized const 'config_option_traits_base<int, 3ul>::value_enum'
./include/lighttpd-cpp/datatype_helpers.hpp: In instantiation of 'const config_values_type_t config_option_traits_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, 1ul>::value_enum':
./include/lighttpd-cpp/datatype_helpers.hpp:347: instantiated from 'handler_t config_option<OptionType, ConfigScopeType, OptionTraits>::set_defaults(const server&) [with OptionType = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int ConfigScopeType = 2ul, OptionTraits = config_option_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]'
src/mod_blank.cpp:6: instantiated from here
./include/lighttpd-cpp/datatype_helpers.hpp:243: error: uninitialized const 'config_option_traits_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, 1ul>::value_enum'
我正在运行 centos 5.5 64bit 我已经在这里编译和安装了一个 lighttpd 版本,我也不明白 lighttpd-cpp 在使用 cpp 构建新的 lighttpd 模块中的作用,我必须从 lighttpd 构建所有东西-cpp 并使用这个版本而不是我从http://www.lighttpd.net/ 下载的 lighttpd 1.4.28?如果是,那很可悲,因为我可能会使用未经过充分测试的 lighttpd 源来丢失更新和版本稳定性,相反,如果我必须在旧的 lighttpd 中实现新模块,该怎么做? :)
【问题讨论】: