I am following your instruction in README.md, and try to compile on windows 7
$ gcc -std=gnu11 -w -o v.exe v.c # Build it with
v.c: In function 'os__getexepath':
v.c:3601:22: error: invalid type argument of unary '*' (have 'DWORD {aka long unsigned int}')
return tos(result, *GetModuleFileName(0, result, os__MAX_PATH));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and
$ gcc --version
gcc.exe (Rev1, Built by MSYS2 project) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
btw this is the only line which forbide v.c to be compiled on windows in mingw64. An improvement. thanks
Windows 10 too, my gcc v8.1.0, error massage is the same.
Modify v.c as follows, and you can compile it manually gcc -std=gnu11 -w -o v.exe v.c
from
return tos(result, *GetModuleFileName(0, result, os__MAX_PATH));
to
return tos(result, GetModuleFileName(0, result, os__MAX_PATH));
if we use os.getexepath() in V code, the following
return tos ( result ,* GetModuleFileName ( 0 , result , os__MAX_PATH ) ) ;
will be generated.
I made PR for this: https://github.com/vlang/v/pull/783
PR #776 fixes the same but v.c needs to be updated too
Fixed.
Most helpful comment
Modify v.c as follows, and you can compile it manually
gcc -std=gnu11 -w -o v.exe v.cfrom
to