How should I set up my local envorinment for C++17?

Revision en1, by MaxWelll, 2024-08-02 09:43:58

I just got a WA verdict from the sample case in a problem that worked on my machine.

The issue was that I had some out-of-boundaries access in a vector. It happens. But the scary part is that it worked on my machine without any complaints.

I saw Mike's post about adding C++17 and it says and I quote:

The exact compilation command line is:

g++.exe -static -DONLINE_JUDGE -Wl,--stack=268435456 -O2 -std=c++17 -o %name%.exe %1 2>compilation.log`

First I tried copying the options but -Wl,--stack=268435456 doesn't work for me. I'm not sure what they do, options for the linker?

I'm using GNU/Linux (Ubuntu 24.04 to be more precise), and my compilation command is

g++ "$filename.cpp" -static -Wall -pedantic -O2 -std=c++17 -DEMWAVE -o "$filename"

I also tried some options that ChatGPT suggested but I could still run my program locally without any indication that something was wrong.

Tags c++17, setup, compilation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English MaxWelll 2024-08-02 10:15:13 233 adding some update about the WA veredict
en1 English MaxWelll 2024-08-02 09:43:58 1037 Initial revision (published)