Skip to content

Instantly share code, notes, and snippets.

@hack-tramp
Last active October 6, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hack-tramp/b19b7675670bb5463bb763c602b5bc05 to your computer and use it in GitHub Desktop.
Save hack-tramp/b19b7675670bb5463bb763c602b5bc05 to your computer and use it in GitHub Desktop.
How to compile AVRA with MS Visual Studio 2019
How to compile AVRA https://github.com/Ro5bert/avra
with MS Visual Studio 2019
New Project > Console Application > C++
(create it empty without any files)
Import all .c and .h files from AVRA src folder
In file.c, you will need to change line
#include <unistd.h> into:
#include "unistd.h"
Add unistd.h to the project from https://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c#826027
In unistd.h change line
#include <getopt.h> to :
#include "getopt.h"
Add getopt.h to the project from https://gist.github.com/ashelly/7776712
To suppress C4996 errors:
Right click on your project, go to properties
Configuration Properties > C/C++ > Preprocessor
Add these (separated by semicolons) to Preprocessor Definitions:
_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;
see here for details: https://stackoverflow.com/questions/16883037/remove-secure-warnings-crt-secure-no-warnings-from-projects-by-default-in-vis#20753468
Compile!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment