FIX94 / wud2app

convert wudump folders and .wud images into cert, tik, tmd and app files
MIT License
58 stars 10 forks source link

compile errors on linux #2

Open ddurdle opened 7 years ago

ddurdle commented 7 years ago

Firstly, main.c: In function ‘main’: main.c:207:2: error: implicit declaration of function ‘mkdir’ [-Werror=implicit-function-declaration] mkdir(outDir);

... mkdir is part of sys/stat.h so need to include:

include <sys/stat.h>

Also, need to update the mkdir with permissions to avoid the following error: main.c: In function ‘main’: main.c:207:2: error: too few arguments to function ‘mkdir’ mkdir(outDir); ^ In file included from main.c:23:0: /usr/include/x86_64-linux-gnu/sys/stat.h:321:12: note: declared here extern int mkdir (const char *path, mode_t __mode)

Fix with: mkdir(outDir,S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH);

Nanolx commented 7 years ago

That's not just a compilation error. It actually makes wud2app work on GNU/Linux in first place (without those code changes it segfaults (in case your compiler does not break on warnings and produces a binary)).