gpt4 book ai didi

c++ - 如何将 CodeSynthesis-XSD 包含到自己的应用程序中?

转载 作者:行者123 更新时间:2023-11-28 00:44:51 24 4
gpt4 key购买 nike

1.) 我如何将 CodeSynthesis-XSD 代码生成包含到我的应用程序中,这样当我将应用程序(Visual Studio 10 中的 QT)提供给其他人时,他不需要安装代码合成?


2.) 我如何指定.cpp.h 文件的输出目录? xsd help 没有列出这样的选项吗?我用树生成这样的:

>xsd cxx-tree "C:\scheme.xsd"

-> 在执行 xsd 之前通过“cd”(更改目录)解决


3.) 我收到不知道如何解决的警告:

warning F002: attribute 'value' is implicitly of anySimpleType
info: did you forget to specify 'type' attribute?
warning T004: generating parsing functions for 18 global elements
info: use --root-element-* options to specify document root(s)

xsd help 中是否还没有列出其他参数?

最佳答案

  1. 运行时库 (libxsd) 仅包含 header ,因此如果您以编译形式提供软件,则最终用户无需安装它。

  2. 使用--output-dir选项

    erik@ubuntu:~$ xsdcxx help cxx-tree 2>&1 | grep -A1 output-dir
--output-dir <dir> Write generated files to <dir> instead of current
directory.

3。关于“警告T004”:

    erik@ubuntu:~$ xsdcxx help cxx-tree 2>&1 | grep -A1 root-element
--root-element-first Treat only the first global element as a document
root.
--root-element-last Treat only the last global element as a document
root.
--root-element-all Treat all global elements as document roots.
--root-element-none Don't treat any global elements as document roots.
--root-element <element> Treat only <element> as a document root. Repeat
this option to specify more than one root element.

如果您未指定这些选项中的任何一个,则暗含 --root-element-all 但您将看到“警告 T004”。 如果 --root-element-all 是您想要的,我建议添加该选项以使警告消失。

关于“警告F002”:抱歉,我不知道。

注意:当 CodeSynthesis XSD 开始将帮助文本打印到标准输出时,将来将不再需要“2>&1”。 http://codesynthesis.com/pipermail/xsd-users/2012-March/003577.html

关于c++ - 如何将 CodeSynthesis-XSD 包含到自己的应用程序中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16771369/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com