[xsd-users] cli unknown option '-I' when compiling xsd-4.0.0

Boris Kolpackov boris at codesynthesis.com
Thu Nov 9 07:38:12 EST 2023


Fred Ramsing <framsing at gmail.com> writes:

> I am trying to compile xsd-4.0.0.

FYI, the latest version is 4.2.0 and it includes binary packages for
quite a few platforms:

https://codesynthesis.com/products/xsd/download.xhtml


> It compiles fine on my local machine, but for some unknown reason on
> a remote server I get the following error: unknown option '-I'
> The previous build step is:
> cli --hxx-suffix .hxx --ixx-suffix .ixx --cxx-suffix .cxx -I
> <path_to_repo>/xsd/xsd    ...

My hunch is that you have a rogue `cli` executable in PATH. Try:

which cli
cli --version


> Is there a workaround for this with cli-1.1.0/xsd-4.0.0?

If you must continue with XSD 4.0.0, you can use the xsd+dep package
which includes all the dependencies as well as the pre-generated CLI
code. For details, see:

https://codesynthesis.com/projects/xsd/extras/build-unix.xhtml


> Off Topic:  cli obviously nice features for handling cli options, but each
> of these dependencies requires yet another requirement that I have to
> download, package for our build system, compile on remote server, publish
> to package repository, when all I want to do is to run the xsd executable
> as part of my project using cmake.

The easiest way is to just use the binary package (.deb, .rpm, etc).

With the latest version we now ship pre-generated CLI source code, though
getting CLI with the build2 package manager wouldn't have added much.

So, my recommendation is to switch to 4.2.0 and use one of the provided
binary packages. If that's not an option and you must build XSD from
source, then bite the bullet and get build2. It's not that hard and
there are detailed instructions:

https://codesynthesis.com/products/xsd/doc/install-build2.xhtml

Also, you may be able to build your own binary package for XSD
automatically:

https://build2.org/bpkg/doc/bpkg-pkg-bindist.xhtml



More information about the xsd-users mailing list