我试图为lighttpd创建自己的模块,几分钟后,我发现这一切都在c中!我需要 map 和我在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++进行自定义模块的方法?
更新资料
由于梅萨,我已经安装了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中实现新模块,该怎么做? :)
最佳答案
您正在编译错误-头文件的路径丢失。如果使用lighttpd-cpp,则应使用构建系统,该系统为 SCons 。安装scons,然后继续README :)
关于c++ - lighttpd-cpp如何编译?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6005656/