See also Framework for a high-level description.

Command-Line Reference

The following options are supported by the usResourceCompiler3 program:

--help, -h

Print usage and exit.

--verbose, -V

Run in verbose mode.

--bundle-name, -n

The bundle name as specified in the US_BUNDLE_NAME compile definition.

--compression-level, -c

Compression level used for zip. Value range is 0 to 9. Default value is 6.

--out-file, -o

Path to output zip file. If the file exists it will be overwritten. If this option is not provided, a temporary zip fie will be created.

--res-add, -r

Path to a resource file, relative to the current working directory.

--zip-add, -z

Path to a file containing a zip archive to be merged into the output zip file.

--manifest-add, -m

Path to the bundle’s manifest file.

--bundle-file, -b

Path to the bundle binary. The resources zip file will be appended to this binary.


  1. Only options --res-add and --zip-add can be specified multiple times.
  2. If option --manifest-add or --res-add is specified, option --bundle-name must be provided.
  3. At-least one of --bundle-file or --out-file options must be provided.


If you are using CMake, consider using the provided usFunctionEmbedResources CMake macro which handles the invocation of the usResourceCompiler3 executable and sets up the correct file dependencies. Otherwise, you also need to make sure that the set of static bundles linked into a shared bundle or executable is also in the input file list of your usResourceCompiler3 call for that shared bundle or executable.

Here is a full example creating a bundle and embedding resource data:

set(bundle_name "org_me_mybundle")
set(srcs mybundle.cpp)

usFunctionGenerateBundleInit(TARGET mybundle OUT srcs)
usFunctionGetResourceSource(TARGET mybundle OUT srcs)

add_library(mybundle ${srcs})
target_link_libraries(mybundle CppMicroServices)

set_property(TARGET mybundle PROPERTY US_BUNDLE_NAME ${bundle_name})

usFunctionEmbedResources(TARGET mybundle
  FILES hello.txt

If you are not using CMake, you can run the resource compiler from the command line yourself.

Example invocations

Construct a zip blob with contents mybundle/manifest.json, merge the contents of zip file into it and write the resulting blob into

usResourceCompiler3 --compression-level 9 --verbose --bundle-name mybundle
  --out-file --manifest-add manifest.json --zip-add

Construct a zip blob with contents mybundle/manifest.json, merge the contents of zip file into it and append the resulting zip blob to mybundle.dylib:

usResourceCompiler3 -V -n mybundle -b mybundle.dylib -m manifest.json

Append the contents of to mybundle.dll:

usResourceCompiler3.exe -b mybundle.dll -z