slice2cpp(1)
π slice2cpp β the Slice-to-C++ compiler, bestie edition
okay so real quick, this is the manual page for slice2cpp(1), which lives in the General Commands Manual section. It's the compiler that takes your Slice files and turns them into C++, and it's lowkey iconic. Let's get into it. π¦
β¨ NAME β¨
slice2cpp β the Slice to C++ compiler. that's it, that's the name. short, sweet, slays. π
πΈ SYNOPSIS πΈ
slice2cpp [options] [files]
like. you give it options. you give it files. it does the thing. periodt. π
π DESCRIPTION π
So slice2cpp compiles Slice files to C++. That's the whole job, and it does it gorgeously. π
Also, during this compilation, the macro __SLICE2CPP__ is defined. so if your Slice code needs to know "hey am I being compiled by slice2cpp rn", it can just vibe check that macro. iykyk. β¨
The full documentation for slice2cpp is available online at:
https://doc.zeroc.com/ice/latest/language-mappings/c++11-mapping/slice2cpp-command-line-options
go read it, it's giving thorough. π«Ά
π₯ OPTIONS π₯
okay bestie this is the part where you actually pay attention, because every single one of these matters. no skipping. π
-h,--helpβ displays the help message. classic. when in doubt, ask for help, that's self-care. π-v,--versionβ displays the compiler version. so you know exactly which queen you're working with. π-DNAMEβ defines the preprocessor symbolNAME. manifesting a symbol into existence. β¨-DNAME=DEFβ defines the preprocessor symbolNAMEwith the valueDEF. same energy, but now with a value attached. π-UNAMEβ undefines the preprocessor symbolNAME. we are un-manifesting. it's gone. not me deleting symbols π-IDIRβ add the directoryDIRto the search path for#includedirectives. so your includes can actually find their friends. π«Ά-Eβ print the preprocessor output on stdout. just the preprocessor output, out loud, on your screen. π--output-dir DIRβ place the generated files into directoryDIR. your files, your folder, your rules. π-d,--debugβ print debug information showing the operation of the Slice parser. it's giving "let me narrate my whole process". π¦--dependβ print dependency information to standard output by default, or to the file specified by the--depend-fileoption. No code is generated when this option is specified. so like, dependencies only, no code, we're just here for the lore. π--depend-xmlβ print dependency information in XML format to standard output by default, or to the file specified by the--depend-fileoption. No code is generated when this option is specified. same as above but make it XML, make it fancy. β¨--depend-file FILEβ directs dependency information to the specified file. The output format depends on whether--dependor--depend-xmlis also specified. so this one is the destination, and the other two decide the vibe of what lands there. π--validateβ checks the provided command-line options for correctness, and does not generate any code. it's the vibe check option. nothing gets generated, everything gets judged. β--header-ext EXTβ changes the file extension for the generated header files from the defaulthtoEXT. glow-up for your file extensions. π--source-ext EXTβ changes the file extension for the generated source files from the defaultcpptoEXT. same glow-up, source file edition. πΈ--add-header HDR[,GUARD]β this option adds an include directive for the specified header at the beginning of the generated source file (preceding any other include directives). IfGUARDis specified, the include directive is protected by the specified guard. soHDRgoes first, first first, before literally everything else, andGUARDis the optional bodyguard. π‘οΈ--include-dir DIRβ modifies#includedirectives in source files to prepend the path name of each header file with the directoryDIR. puttingDIRin front of every header path like a little prefix accessory. π--impl-c++11β generate sample implementation files for the C++11 mapping. This option will not overwrite an existing file. so like, it's polite, it will not touch what's already there. π«Ά--impl-c++98β generate sample implementation files for the C++98 mapping. This option will not overwrite an existing file. same polite energy, different mapping. π--checksumβ generate checksums for Slice definitions. for when you need receipts. π§Ύ
π SEE ALSO π
your other favs, the whole compiler friend group:
slice2cs(1)slice2java(1)slice2js(1)slice2matlab(1)slice2objc(1)slice2php(1)slice2py(1)slice2rb(1)slice2swift(1)
and that's the whole page, bestie!! this was slice2cpp(1) from the General Commands Manual, and that's the official slice2cpp(1) footer energy right there. go compile something gorgeous. no cap. πβ¨ππ¦
π¦ where this page comes from
- arch rolling: zeroc-ice 3.7.10-3 Β· GPL-2.0-only AND LicenseRef-ICE
- debian bookworm: zeroc-ice-compilers 3.7.8-2.1+b1 Β· GPL-2.0+exceptions
- debian trixie: zeroc-ice-compilers 3.7.10-3.1 Β· GPL-2.0+exceptions
- ubuntu jammy: zeroc-ice-compilers 3.7.6-4ubuntu1 Β· GPL-2.0+exceptions
- ubuntu noble: zeroc-ice-compilers 3.7.10-2.1build1 Β· GPL-2.0+exceptions
- ubuntu questing: zeroc-ice-compilers 3.7.10-3.1
- ubuntu resolute: zeroc-ice-compilers 3.7.10-4build2 Β· GPL-2.0+exceptions
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms