Closed joe-conigliaro closed 5 years ago
function string os__home_dir()
`string os__home_dir() {
string home = os__getenv(tos2("HOME"));
//home = os__getenv(tos2("HOMEDRIVE"));
//home = string_add(home, os__getenv(tos2("HOMEPATH")));
int max = 256;
byte *buf = v_malloc(max);
GetModuleFileName(NULL, buf, max);
int nLen=strlen(buf);
byte p; p= buf+nLen; while(p!=buf) { if((p == '\') || (p == '//')) { p='\x00'; break; } p--; } nLen=strlen(buf); home = tos(buf, nLen); home = string_add(home, tos2("/../../../"));
;
home = string_add(home, tos2("/"));
return home; }`
@SongTianZuo whats this for, were you having other problem with os__home_dir?
chage the string os__home_dir funtion , make it works in Flexible Path 'anywhere'/code/v , not need in %home%/code/v
chage the string os__home_dir funtion , make it works in Flexible Path 'anywhere'/code/v , not need in %home%/code/v
Ahh yes
Thanks.
I finally got access to a Windows machine, I'll make it work.
Windows line endings are now supported, by the way.
@medvednikov cool thanks! just need to do something about getline() and backtrace() (maybe CaptureStackBackTrace() on win?)
Mind sharing the binary?
Thanks, but I still get errors:
./vc -o v .
(char code=0) pos=4594 len=4821
panic: array.v:228
invalid character ``
exit():
This error points to the end of the file, which is a \0
char. I have windows line endings as Alex said they work now. I also tried fixing this myself before seeing this pull, and even editing v.c to ignore the \0
I get other runtime panics.
@ntrel actually that's still line ending error because for me it fixed that. EDITED
@medvednikov My last post that was about printf isn't relevant any more, I woke up and now it's working again ( i dunno if i was half asleep or tripping) but I didn't even do a pull from the repo so i dunno what the hell is going on lol.
@nachoverdon I guess if you really want, I don't like the idea of distributing binaries though
I get the vc.exe,but i can't compile any .v file
I get the vc.exe,but i can't compile any .v file
Any errors?
Any errors? no error,but i can‘t get binary file
@liov if you run vc.exe does it do anything?
@liov if you run vc.exe does it do anything?
I think it's compiled, but there's no output
@liov hrm If i think what it could be i'll let you know, there are also other issues with windows at the moment, I'm trying to work some out. Maybe stick wish WSL for now
@medvednikov what do you think is happening here?
Thanks, but I still get errors:
./vc -o v . (char code=0) pos=4594 len=4821 panic: array.v:228 invalid character `` exit():
This error points to the end of the file, which is a
\0
char. I have windows line endings as Alex said they work now. I also tried fixing this myself before seeing this pull, and even editing v.c to ignore the\0
I get other runtime panics.
I have the same error, but replace all characters: \r\n
to \n
, then compile it ok, but build nothing, it will not generate v
file. I use MinGW, gcc to compile.
and
So, to make it most reproducable I tried to do this inside docker and then wanted to cross-compile to compiler to windows from linux, BUT this is what I get on MASTER and on 0.1.16:
root@5cbe9bf96f09:/etc/vlang# v -o v.exe -os windows compiler Cross compiling for Windows...
clang: error: no such file or directory: '/root//.vmodules//v.exe.c'
clang: error: no input files Cross compilation for Windows failed. Make sure you have clang installed.
For some reason it is searching for the intermediate C file in the modules folder...
When I just copy the file there, I get this:
root@5cbe9bf96f09:/etc/vlang# v -o v.exe -os windows compiler Cross compiling for Windows...
/root//.vmodules//v.exe.c:15:10: fatal error: 'windows.h' file not found
#include <windows.h>
^~~~~~~~~~~ 1 error generated.
Cross compilation for Windows failed. Make sure you have clang installed.
I did install the winroot.zip from v0.1.10, BUT this really doesn't container the windows.h file... So, no idea how this even is supposed to work.
I think the best would be if this project had some CI for building the releases - let me know if you need support there.
All Windows issues were fixed.
Edited. The instructions that were here are no longer current. Instructions can now be found https://github.com/vlang