1 vote

Is there any way to compile C++ code by g++ without any disk-writing?

sure; just set the TMPDIR environment variable before you call gcc (or g++ or any other GCC compiler). Set it to a path that's on a tmpfs mount. Chances are your /tmp or /run, or /run/user/$(id -u)/ ...
Marcus Müller's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible