wud2app icon indicating copy to clipboard operation
wud2app copied to clipboard

compile errors on linux

Open ddurdle opened this issue 8 years ago • 1 comments

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);

ddurdle avatar Jan 03 '17 22:01 ddurdle

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)).

Nanolx avatar Jan 07 '17 20:01 Nanolx