Using -static flag with different operating systems

Revision en1, by sweetwrapper, 2022-03-27 16:47:57

The static flag is a flag that's used in most online judges to allow C++ binaries to run without the relevant libraries. It also ensures more consistency in runtimes and memory measurements, and is thus used in large competitions like IOI.

Here's an exerpt from IOI 2020: ~~~~~ /usr/bin/g++ -DEVAL -std=gnu++17 -O2 -pipe -static -s -o task grader.cpp task.cpp ~~~~~

I'm currently working on a non-linux computer and often run into the problem that static simply isnt available to be used. Could I ask if anyone has found some solution that allows the flag to be used on other systems? Thanks!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English sweetwrapper 2022-03-27 16:47:57 690 Initial revision (published)