vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.88k stars 2.17k forks source link

Tetris doesn't run #832

Closed pramodbharti closed 5 years ago

pramodbharti commented 5 years ago

V version: 0.1.10 OS: Ubuntu 16.04.6 LTS x86_64

What did you do? Tried running tetris.v file using command $v run <path-to-file>/tetris.v These dependencies already installed. libglfw3 libglfw3-dev libfreetype6-dev libcurl3-dev libglfw3 is already the newest version (3.1.2-3). libglfw3-dev is already the newest version (3.1.2-3). libcurl4-openssl-dev is already the newest version (7.47.0-1ubuntu2.13). libfreetype6-dev is already the newest version (2.6.1-0.1ubuntu2.3).

What did you expect to see?

Something like this :point_down: tetris window What did you see instead?

failed to credate glfw  window
create window wnd=(nil) ptr==0xe7eb30
#version 330 core
layout (location = 0) in vec4 vertex; // <vec2 pos, vec2 tex>
out vec2 TexCoords;

uniform mat4 projection;

void main()
{
    gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
    TexCoords = vertex.zw;
}  
Failed to initialize glad OpenGL context
medvednikov commented 5 years ago

Hi @pramodbharti

Sorry for the delay.

Driver issue most likely.

Can you create an empty window with GLFW/C?

https://www.glfw.org/docs/latest/quick.html

jesseflorig commented 5 years ago

V version: 0.1.16 OS: MacOS Mojave 10.14.5

Error:

ld: library not found for -lglfw
clang: error: linker command failed with exit code 1 (use -v to see invocation)
V panic: clang error

Edit:

brew install glfw
medvednikov commented 5 years ago

@jesseflorig https://github.com/vlang/v#running-the-examples

brew install glfw

jesseflorig commented 5 years ago

@medvednikov I was so stoked after running make I skipped the examples readme 😅