I've been using the UVa Online Judge to solve some programming challenges, and, when submitting my solutions, I'm told the judge will compile my code using the following parameters to GCC/G++ that I don't know: -lm -lcrypt -pipe -DONLINE_JUDGE
.
What do they do? Thank you very much in advance!
The gcc -g flag tells gcc to generate and embed debug information. ulimit -c is used to enable core file generation. You can have either of these without the other. Copy link CC BY-SA 2.5.
-g means to leave debugging information in the output file, it's unrelated to renaming. -o means to put the result in the specified file instead of the default filename ( abc.o for object files, a. out for linked executable files).
g++ is used to compile C++ program. gcc is used to compile C program. g++ can compile any . c or . cpp files but they will be treated as C++ files only.
"-lm -lcrypt" specifies to link with the math and cryptography libraries - useful if you're going to use the functions defined in math.h and crypt.h. "-pipe" just means it won't create intermediate files but will use pipes instead. "-DONLINE_JUDGE"
defines a macro called "ONLINE_JUDGE
", just as if you'd put a "#define" in your code. I guess that's so you can put something specific to the judging in your code in an "#ifdef"/"#endif" block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With