Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vid doesn't build #47

Closed
pepa65 opened this issue Nov 9, 2019 · 17 comments
Closed

vid doesn't build #47

pepa65 opened this issue Nov 9, 2019 · 17 comments

Comments

@pepa65
Copy link

pepa65 commented Nov 9, 2019

On Ubuntu 18.04 (mentioned dependencies installed)
v version: V 0.1.22 be4eaa6
Output of v .:

warning: use "_linux.v" file name instead of "/home/pp/git/v/vlib/ui/ui_lin.v"
./vid.v:1152:34: `vid` is declared as mutable, but it was never changed
 1150| 
 1151| // Find current word under cursor
 1152| fn (vid mut Vid) word_under_cursor() string {
                                        ^
 1153| 	line := vid.view.line()
 1154| 	// First go left
@watzon
Copy link

watzon commented Jan 16, 2020

Looks like this has been fixed. Can you confirm @pepa65?

@pepa65
Copy link
Author

pepa65 commented Jan 17, 2020

After pulling v again from current, making and installing that, I now get as output of v .:

./vid.v:15:3: cannot import module "ui" (not found)
   13| 	os
   14| 	time
   15| 	ui
         ^
   16| 	strings
   17| 	//darwin

@watzon
Copy link

watzon commented Jan 17, 2020

Did you pull the most recent version of vid as well? Because that line has been changed.

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

Sorry, I forgot... Now I'm getting:

warning: ./vid.v:1819:1: the following imports were never used: 
 * uiold
In file included from /home/pp/git/v/thirdparty/stb_image/stb_image.h:547:0,
                 from /home/pp/.cache/v/vid.tmp.c:297:
/home/pp/git/v/thirdparty/stb_image/stb_image.h: In function ‘stbi__...
(Use `v -g` to print the entire error message)

V error: C error. This should never happen. 
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose

@watzon
Copy link

watzon commented Jan 18, 2020

Gonna need the full error trace. Build with -g.

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

After v -g .:

C compiler=cc
warning: ./vid.v:1819:1: the following imports were never used: 
 * uiold
In file included from /home/pp/git/v/thirdparty/stb_image/stb_image.h:547:0,
                 from /home/pp/git/vid/zquery.v:361:
/home/pp/git/v/thirdparty/stb_image/stb_image.h: In function ‘stbi__shiftsigned’:
/home/pp/git/v/thirdparty/stb_image/stb_image.h:5116:18: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
    STBI_ASSERT(v >= 0 && v < 256);
                  ^
/home/pp/git/v/thirdparty/stb_image/stb_image.h:5116:4: note: in expansion of macro ‘STBI_ASSERT’
    STBI_ASSERT(v >= 0 && v < 256);
    ^~~~~~~~~~~
/home/pp/git/v/thirdparty/stb_image/stb_image.h:5116:18: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
    STBI_ASSERT(v >= 0 && v < 256);
                  ^
/home/pp/git/v/thirdparty/stb_image/stb_image.h:5116:4: note: in expansion of macro ‘STBI_ASSERT’
    STBI_ASSERT(v >= 0 && v < 256);
    ^~~~~~~~~~~
/home/pp/git/v/vlib/gl/1shader.v: In function ‘gl__new_shader’:
/home/pp/git/v/vlib/gl/1shader.v:108:8: warning: variable ‘dir’ set but not used [-Wunused-but-set-variable]
  // Already have absolute path
        ^~~
/home/pp/git/v/vlib/gl/gl.v: In function ‘gl__init_glad’:
/home/pp/git/v/vlib/gl/gl.v:15:11: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
  ok := C.gladLoadGL()
           ^~~~~~~~~~
/home/pp/git/v/vlib/gl/gl.v: In function ‘gl__shader_source’:
/home/pp/git/v/vlib/gl/gl.v:43:34: warning: passing argument 3 of ‘glad_glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
  C.glShaderSource(shader, a, &source.str, b)
                                  ^
/home/pp/git/v/vlib/gl/gl.v:43:34: note: expected ‘const GLchar * const* {aka const char * const*}’ but argument is of type ‘byte ** {aka unsigned char **}’
/home/pp/git/v/vlib/gl/gl.v:43:51: warning: passing argument 4 of ‘glad_glShaderSource’ makes pointer from integer without a cast [-Wint-conversion]
  C.glShaderSource(shader, a, &source.str, b)
                                                   ^
/home/pp/git/v/vlib/gl/gl.v:43:51: note: expected ‘const GLint * {aka const int *}’ but argument is of type ‘int’
/home/pp/git/v/vlib/gl/gl.v: In function ‘gl__shader_info_log’:
/home/pp/git/v/vlib/gl/gl.v:77:45: warning: pointer targets in passing argument 4 of ‘glad_glGetShaderInfoLog’ differ in signedness [-Wpointer-sign]
  C.glGetShaderInfoLog(shader, 512, 0, info_log)
                                             ^~~     
/home/pp/git/v/vlib/gl/gl.v:77:45: note: expected ‘GLchar * {aka char *}’ but argument is of type ‘byte * {aka unsigned char *}’
/home/pp/git/v/vlib/gl/gl.v: In function ‘gl__get_program_info_log’:
/home/pp/git/v/vlib/gl/gl.v:83:48: warning: pointer targets in passing argument 4 of ‘glad_glGetProgramInfoLog’ differ in signedness [-Wpointer-sign]
  C.glGetProgramInfoLog(program, 1024, 0, info_log)
                                                ^~~     
/home/pp/git/v/vlib/gl/gl.v:83:48: note: expected ‘GLchar * {aka char *}’ but argument is of type ‘byte * {aka unsigned char *}’
/home/pp/git/v/vlib/gl/gl.v: In function ‘gl__draw_elements’:
/home/pp/git/v/vlib/gl/gl.v:147:43: warning: passing argument 4 of ‘glad_glDrawElements’ makes pointer from integer without a cast [-Wint-conversion]
  C.glDrawElements(mode, count, typ, indices)
                                           ^~     
/home/pp/git/v/vlib/gl/gl.v:147:43: note: expected ‘const void *’ but argument is of type ‘int’
/home/pp/git/v/vlib/gl/gl.v: In function ‘gl__vertex_attrib_pointer’:
/home/pp/git/v/vlib/gl/gl.v:177:74: warning: passing argument 6 of ‘glad_glVertexAttribPointer’ makes pointer from integer without a cast [-Wint-conversion]
  C.glVertexAttribPointer(index, size, typ, normalized, stride, ptr)
                                                                          ^  
/home/pp/git/v/vlib/gl/gl.v:177:74: note: expected ‘const void *’ but argument is of type ‘int’
/home/pp/git/v/vlib/stbi/stbi.v: In function ‘stbi__load_from_memory’:
/home/pp/git/v/vlib/stbi/stbi.v:52:39: warning: pointer targets in passing argument 1 of ‘stbi_load_from_memory’ differ in signedness [-Wpointer-sign]
  res.data = C.stbi_load_from_memory(buf, 3812, &res.width, &res.height, &res.nr_channels, flag)
                                       ^
In file included from /home/pp/git/vid/zquery.v:361:0:
/home/pp/git/v/thirdparty/stb_image/stb_image.h:1287:18: note: expected ‘const stbi_uc * {aka const unsigned char *}’ but argument is of type ‘char *’
 STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
                  ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/pp/git/vid/zquery.v:363:0:
/home/pp/git/v/vlib/glfw/glfw.v: In function ‘glfw__set_cursor’:
/home/pp/git/v/thirdparty/glfw/GLFW/glfw3.h:1051:37: warning: passing argument 2 of ‘glfwSetCursor’ makes pointer from integer without a cast [-Wint-conversion]
 #define GLFW_IBEAM_CURSOR           0x00036002
                                     ^
/home/pp/git/v/vlib/glfw/glfw.v:247:23: note: in expansion of macro ‘GLFW_IBEAM_CURSOR’
  C.glfwSetCursor(0, C.GLFW_IBEAM_CURSOR)
                       ^~~~~~~~~~~~~~~~~
In file included from /home/pp/git/vid/zquery.v:363:0:
/home/pp/git/v/thirdparty/glfw/GLFW/glfw3.h:4329:14: note: expected ‘GLFWcursor * {aka struct GLFWcursor *}’ but argument is of type ‘int’
 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
              ^~~~~~~~~~~~~
In file included from /home/pp/git/vid/zquery.v:363:0:
/home/pp/git/v/vlib/glfw/glfw.v: In function ‘glfw__Window_set_cursor’:
/home/pp/git/v/thirdparty/glfw/GLFW/glfw3.h:1051:37: warning: passing argument 2 of ‘glfwSetCursor’ makes pointer from integer without a cast [-Wint-conversion]
 #define GLFW_IBEAM_CURSOR           0x00036002
                                     ^
/home/pp/git/v/vlib/glfw/glfw.v:252:30: note: in expansion of macro ‘GLFW_IBEAM_CURSOR’
 
                              ^                
In file included from /home/pp/git/vid/zquery.v:363:0:
/home/pp/git/v/thirdparty/glfw/GLFW/glfw3.h:4329:14: note: expected ‘GLFWcursor * {aka struct GLFWcursor *}’ but argument is of type ‘int’
 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
              ^~~~~~~~~~~~~
/home/pp/git/v/vlib/glfw/glfw.v: In function ‘glfw__get_monitor_size’:
/home/pp/git/v/vlib/glfw/glfw.v:272:20: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  mode := C.glfwGetVideoMode(C.glfwGetPrimaryMonitor())
                    ^~~~~~~~~~~~~~~~
/home/pp/git/v/vlib/glm/glm.v: In function ‘glm__identity2’:
/home/pp/git/v/vlib/glm/glm.v:254:31: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  res[0] = 1
                               ^
/home/pp/git/v/vlib/glm/glm.v:255:31: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  res[5] = 1
                               ^
/home/pp/git/v/vlib/glm/glm.v:256:32: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  res[10] = 1
                                ^
/home/pp/git/v/vlib/glm/glm.v:261:32: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  // # gl__Shader_set_mat4(shader, tos2("projection"), f) ;
                                ^
/home/pp/git/v/vlib/freetype/freetype.v: In function ‘freetype__ft_load_char’:
/home/pp/git/v/vlib/freetype/freetype.v:116:23: warning: pointer targets in passing argument 2 of ‘glad_glGenTextures’ differ in signedness [-Wpointer-sign]
  C.glGenTextures(1, &texture)
                       ^
/home/pp/git/v/vlib/freetype/freetype.v:116:23: note: expected ‘GLuint * {aka unsigned int *}’ but argument is of type ‘int *’
/home/pp/git/v/vlib/freetype/freetype.v: In function ‘freetype__new_context’:
/home/pp/git/v/vlib/freetype/freetype.v:168:12: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
  mut ret := C.FT_Init_FreeType(&ft)
            ^~~~~~~~~~~~~~~~
/home/pp/git/v/vlib/freetype/freetype.v:188:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  ret = int(C.FT_New_Face(ft, font_path.str, 0, &face))
       ^
/home/pp/git/v/vlib/freetype/freetype.v: In function ‘freetype__FreeType_private_draw_text’:
/home/pp/git/v/vlib/freetype/freetype.v:288:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
    idx := _rune[0]
           ^
/home/pp/git/v/vlib/freetype/freetype.v: In function ‘freetype__FreeType_text_width’:
/home/pp/git/v/vlib/freetype/freetype.v:366:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
    idx := _rune[0]
           ^
/usr/bin/ld: cannot find -lglfw
collect2: error: ld returned 1 exit status
V error: C error. This should never happen. 
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

I did a v up and tried again v . on vid:

warning: ./vid.v:1819:1: the following imports were never used: 
 * uiold
 -lglfw
collect2: error: ld returned 1 exit statusV error: C error. This should never happen. 
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose

This was so different from the last try I thought I'd post again.

@medvednikov
Copy link
Member

If you follow instructions in the readme, everything will work.

Install glfw.

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

dpkg -l |grep glfw:

ii  libglfw3:amd64                         3.2.1-1                                         amd64        portable library for OpenGL, window and input (x11 libraries)
ii  libglfw3-dev:amd64                     3.2.1-1                                         amd64        portable library for OpenGL, window and input (development files)

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

But just now trying v . on vid gives:

warning: ./vid.v:1819:1: the following imports were never used: 
 * uiold

And vid gets built. Can't use it yet though, it's unresponsive.

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

Usually it's not good to close an issue before you get confirmation that it's working.

@medvednikov medvednikov reopened this Jan 18, 2020
@medvednikov
Copy link
Member

What did you do differently to make it build?

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

I did cd git/vid and then v .
But the editor doesn't do anything. I think I'll leave you to work on it for a bit, because I don't know how I can help. I think v looks fantastic, and I'm really looking forward to using it!

@pepa65 pepa65 closed this as completed Jan 18, 2020
@medvednikov
Copy link
Member

medvednikov commented Jan 18, 2020

Try running it with ./vid path_to_git_project and use ctrl-p to navigate files.

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

./vid .

create window wnd=0x559d15d47fb0 ptr==0x559d15d46d10
Trying to load font from RobotoMono-Regular.ttf
["./vid", "."]
PATH="." cur_dir="/home/pp/git/vid"
load session "/home/pp/.vid/session"
Segmentation fault

(There is no /home/pp/.vid/session.)

@pepa65
Copy link
Author

pepa65 commented Jan 18, 2020

If I copy the file RobotoMono-Regular.ttf into the vid directory and try to open a single file, it works:
./vid timer.v
And I can navigate the file and insert/delete etc.

@watzon
Copy link

watzon commented Jan 18, 2020

./vid .

create window wnd=0x559d15d47fb0 ptr==0x559d15d46d10
Trying to load font from RobotoMono-Regular.ttf
["./vid", "."]
PATH="." cur_dir="/home/pp/git/vid"
load session "/home/pp/.vid/session"
Segmentation fault

(There is no /home/pp/.vid/session.)

I've gotten this too actually, when trying to open a path. Works fine with a single file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants