V: glfw3.dll: file not recognized

Created on 15 Jan 2020  路  18Comments  路  Source: vlang/v

V version:
0.1.24 9f31390v
OS:
Windows 10 64bit

What did you do?
I installed mingw-w64, and I build V from source.
I tried to run

v run examples\tetris\tetris.v

What did you expect to see?
I can play tetris

What did you see instead?

...\git\v\thirdparty\glfw/glfw3.dll: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Bug

All 18 comments

you need to put libglfw3.a from glfw windows distribution

Thank you your reply.
I downloaded pre-build-binary

I put libglfw3.a(32bit) on v\thirdparty\glfw, I got this error.

...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x83): undefined reference to `CreateDCW@16'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xdb): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x136): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x16a): undefined reference to `DeleteDC@4'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x2cc): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x2e3): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x92d): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x944): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xabd): undefined reference to `GetDeviceCaps@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xad4): more undefined references to `GetDeviceCaps@8' follow
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xf06): undefined reference to `CreateDCW@16'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xf1b): undefined reference to `GetDeviceGammaRamp@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0xf26): undefined reference to `DeleteDC@4'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x107b): undefined reference to `CreateDCW@16'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x108c): undefined reference to `SetDeviceGammaRamp@8'
...\v\thirdparty\glfw/libglfw3.a(win32_monitor.c.obj):win32_monitor.c:(.text+0x1097): undefined reference to `DeleteDC@4'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x24f): undefined reference to `CreateDIBSection@24'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x29c): undefined reference to `CreateBitmap@20'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x33a): undefined reference to `DeleteObject@4'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x345): undefined reference to `DeleteObject@4'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x3e3): undefined reference to `DeleteObject@4'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x561): undefined reference to `CreateRectRgn@16'
...\v\thirdparty\glfw/libglfw3.a(win32_window.c.obj):win32_window.c:(.text+0x5fc): undefined reference to `DeleteObject@4'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x14a): undefined reference to `SwapBuffers@4'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x41c): undefined reference to `ChoosePixelFormat@8'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x42f): undefined reference to `SetPixelFormat@12'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xc39): undefined reference to `DescribePixelFormat@16'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xd5f): undefined reference to `DescribePixelFormat@16'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xd87): undefined reference to `SetPixelFormat@12'
...\v\thirdparty\glfw/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x140c): undefined reference to `DescribePixelFormat@16'
collect2.exe: error: ld returned 1 exit status

And I put libglfw3.a(64bit) on v\thirdparty\glfw, I got this error.

.../v/vlib/glfw/glfw.v:97: undefined reference to `glfwInit'
.../v/vlib/glfw/glfw.v:98: undefined reference to `glfwWindowHint'
.../v/vlib/glfw/glfw.v:99: undefined reference to `glfwWindowHint'
.../v/vlib/glfw/glfw.v:100: undefined reference to `glfwWindowHint'
.../v/vlib/glfw/glfw.v:101: undefined reference to `glfwWindowHint'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_destroy':
.../v/vlib/glfw/glfw.v:105: undefined reference to `glfwDestroyWindow'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__terminate':
.../v/vlib/glfw/glfw.v:109: undefined reference to `glfwTerminate'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__window_hint':
.../v/vlib/glfw/glfw.v:118: undefined reference to `glfwWindowHint'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__create_window':
.../v/vlib/glfw/glfw.v:129: undefined reference to `glfwCreateWindow'
.../v/vlib/glfw/glfw.v:132: undefined reference to `glfwTerminate'
.../v/vlib/glfw/glfw.v:135: undefined reference to `glfwSetWindowUserPointer'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_set_title':
.../v/vlib/glfw/glfw.v:144: undefined reference to `glfwSetWindowTitle'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_make_context_current':
.../v/vlib/glfw/glfw.v:148: undefined reference to `glfwMakeContextCurrent'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__swap_interval':
.../v/vlib/glfw/glfw.v:152: undefined reference to `glfwSwapInterval'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__wait_events':
.../v/vlib/glfw/glfw.v:156: undefined reference to `glfwWaitEvents'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__poll_events':
.../v/vlib/glfw/glfw.v:160: undefined reference to `glfwPollEvents'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__set_should_close':
.../v/vlib/glfw/glfw.v:164: undefined reference to `glfwSetWindowShouldClose'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_should_close':
.../v/vlib/glfw/glfw.v:168: undefined reference to `glfwWindowShouldClose'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_swap_buffers':
.../v/vlib/glfw/glfw.v:172: undefined reference to `glfwSwapBuffers'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_onmousemove':
.../v/vlib/glfw/glfw.v:176: undefined reference to `glfwSetCursorPosCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_set_mouse_button_callback':
.../v/vlib/glfw/glfw.v:180: undefined reference to `glfwSetMouseButtonCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_on_click':
.../v/vlib/glfw/glfw.v:184: undefined reference to `glfwSetMouseButtonCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_set_scroll_callback':
.../v/vlib/glfw/glfw.v:188: undefined reference to `glfwSetScrollCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_on_scroll':
.../v/vlib/glfw/glfw.v:192: undefined reference to `glfwSetScrollCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__post_empty_event':
.../v/vlib/glfw/glfw.v:196: undefined reference to `glfwPostEmptyEvent'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_onkeydown':
.../v/vlib/glfw/glfw.v:200: undefined reference to `glfwSetKeyCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_onchar':
.../v/vlib/glfw/glfw.v:204: undefined reference to `glfwSetCharModsCallback'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__get_time':
.../v/vlib/glfw/glfw.v:208: undefined reference to `glfwGetTime'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__key_pressed':
.../v/vlib/glfw/glfw.v:212: undefined reference to `glfwGetKey'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_get_clipboard_text':
.../v/vlib/glfw/glfw.v:216: undefined reference to `glfwGetClipboardString'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_set_clipboard_text':
.../v/vlib/glfw/glfw.v:220: undefined reference to `glfwSetClipboardString'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__get_cursor_pos':
.../v/vlib/glfw/glfw.v:226: undefined reference to `glfwGetCursorPos'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_get_cursor_pos':
.../v/vlib/glfw/glfw.v:233: undefined reference to `glfwGetCursorPos'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__set_cursor':
.../v/vlib/glfw/glfw.v:247: undefined reference to `glfwSetCursor'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_set_cursor':
.../v/vlib/glfw/glfw.v:252: undefined reference to `glfwSetCursor'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_user_ptr':
.../v/vlib/glfw/glfw.v:256: undefined reference to `glfwGetWindowUserPointer'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_set_user_ptr':
.../v/vlib/glfw/glfw.v:260: undefined reference to `glfwSetWindowUserPointer'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__get_monitor_size':
.../v/vlib/glfw/glfw.v:272: undefined reference to `glfwGetPrimaryMonitor'
.../v/vlib/glfw/glfw.v:272: undefined reference to `glfwGetVideoMode'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_get_window_size':
.../v/vlib/glfw/glfw.v:282: undefined reference to `glfwGetWindowSize'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__Window_get_framebuffer_size':
.../v/vlib/glfw/glfw.v:289: undefined reference to `glfwGetFramebufferSize'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `glfw__get_window_user_pointer':
.../v/vlib/glfw/glfw.v:298: undefined reference to `glfwGetWindowUserPointer'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `freetype__ft_load_char':
.../v/vlib/freetype/freetype.v:108: undefined reference to `FT_Load_Char'
C:\Users\...\AppData\Local\Temp\ccpe0NTt.o: In function `freetype__new_context':
.../v/vlib/freetype/freetype.v:168: undefined reference to `FT_Init_FreeType'
.../v/vlib/freetype/freetype.v:188: undefined reference to `FT_New_Face'
.../v/vlib/freetype/freetype.v:195: undefined reference to `FT_Set_Pixel_Sizes'

Which file should I put?

Copy to C:\windows\system32

  1. looks like you are using mingw-w64 32 bit (i686) compiler so you need 32-bit glfw.
  2. binary libglfw3.a looks broken, try to use libglfw3dll.a, you need to edit vlib\glfw\glfw.v and replace -lglfw3 with -lglfw3dll.
    Alternatively you can rebuild glfw with your compiler, it will automatically pick correct settings without changes in V

I'm close to removing glfw dependency :)

@dhonx still same error.

@vitalyster
I tried, but I got still error.

C:\Users\...\AppData\Local\Temp\ccVnVsYt.o: In function `freetype__ft_load_char':
C:/Users/.../Documents/git/v/vlib/freetype/freetype.v:108: undefined reference to `FT_Load_Char'
C:\Users\...\AppData\Local\Temp\ccVnVsYt.o: In function `freetype__new_context':
C:/Users/.../Documents/git/v/vlib/freetype/freetype.v:168: undefined reference to `FT_Init_FreeType'
C:/Users/.../Documents/git/v/vlib/freetype/freetype.v:188: undefined reference to `FT_New_Face'
C:/Users/.../Documents/git/v/vlib/freetype/freetype.v:195: undefined reference to `FT_Set_Pixel_Sizes'
collect2.exe: error: ld returned 1 exit status
V error: C error. This should never happen.

@horitaku1124 install freetype as described in README

I deleted freetype directory and try git clone --depth=1 https://github.com/ubawurinna/freetype-windows-binaries thirdparty/freetype/ again.
but same error

It means .a files from that binary distribution does not match your architecture/compiler and you need to rebuild

I tried build GLFW from source.

-- Install configuration: ""
-- Up-to-date: C:/Program Files (x86)/GLFW/include/GLFW
-- Up-to-date: C:/Program Files (x86)/GLFW/include/GLFW/glfw3.h
-- Up-to-date: C:/Program Files (x86)/GLFW/include/GLFW/glfw3native.h
-- Up-to-date: C:/Program Files (x86)/GLFW/lib/cmake/glfw3/glfw3Config.cmake
-- Up-to-date: C:/Program Files (x86)/GLFW/lib/cmake/glfw3/glfw3ConfigVersion.cmake
-- Up-to-date: C:/Program Files (x86)/GLFW/lib/cmake/glfw3/glfw3Targets.cmake
-- Up-to-date: C:/Program Files (x86)/GLFW/lib/cmake/glfw3/glfw3Targets-noconfig.cmake
-- Up-to-date: C:/Program Files (x86)/GLFW/lib/pkgconfig/glfw3.pc
-- Installing: C:/Program Files (x86)/GLFW/lib/libglfw3.a

But there is no glfw3dll file in the list.

There is libglfw3.a which you need to put into thirdparty/glfw

libglfw3.a will link glfw statically to your progam. If you want to use glfw from dll then you need to configure glfw build as cmake -DBUILD_SHARED_LIBS=ON and then link to libglfw3dll.a

I could get glfw3.dll then I put this file on v\thirdparty\glfw but I got this error.

C:/tools/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lglfw3dll
collect2.exe: error: ld returned 1 exit status
V error: C error. This should never happen.

V tries to link -lglfw3dll because you are edited that, it links -lglfw3 by default

Sorry to forget that.
I tried to delete v , and clone again.
But I got strange error.

>make.bat
Building V
git version 2.25.0.windows.1
Downloading v.c...
Attempting to build v.c with GCC...
Now using V to build V...
V build OK!
V 0.1.24 ed55778

>v run examples\tetris\tetris.v
.h"
          ^~~~~~~~~~~~
compilation terminated.V error: C error. This should never happen.
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose

v -g run examples\tetris\tetris.v to view full error

I got this error. I think freetype.dll is already built.

C compiler=gcc
C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:540: warning: "UNICODE" redefined
<command-line>: note: this is the location of the previous definition
C:\Users\...\Documents\git\vlang\vlib\builtin\builtin.v: In function 'print':
C:\Users\...\Documents\git\vlang\vlib\builtin\builtin.v:115:58: warning: passing argument 4 of 'WriteConsoleW' from incompatible pointer type [-Wincompatible-pointer-types]
    C.WriteConsole(output_handle, wide_str, wide_len, &bytes_written, 0)
                                                          ^~~~~~~~~~~~~~
In file included from C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/windows.h:74,
                 from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:541:
C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/wincon.h:260:122: note: expected 'LPDWORD' {aka 'long unsigned int *'} but argument is of type 'int *'
   WINBASEAPI WINBOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput,CONST VOID *lpBuffer,DWORD nNumberOfCharsToWrite,LPDWORD lpNumberOfCharsWritten,LPVOID lpReserved);
                                                                                                                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\builtin\builtin.v:117:58: warning: passing argument 4 of 'WriteFile' from incompatible pointer type [-Wincompatible-pointer-types]
    C.WriteFile(output_handle, s.str, s.len, &bytes_written, 0)
                                                          ^~~~~
In file included from C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/winbase.h:18,
                 from C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/windows.h:70,
                 from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:541:
C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/fileapi.h:175:109: note: expected 'LPDWORD' {aka 'long unsigned int *'} but argument is of type 'int *'
   WINBASEAPI WINBOOL WINAPI WriteFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
                                                                                                     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\builtin\int.v: In function 'u64_hex':
C:\Users\...\Documents\git\vlang\vlib\builtin\int.v:163:15: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  len := if n >= u64(0) { n.str().len + 3 } else { 19 }
               ^~
C:\Users\...\Documents\git\vlang\vlib\stbi\stbi.v: In function 'stbi__load_from_memory':
C:\Users\...\Documents\git\vlang\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 C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:540:
C:\Users\...\Documents\git\vlang\thirdparty\stb_image/stb_image.h:375: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 *channels_in_file, int desired_channels);
                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\glm\glm.v: In function 'glm__identity2':
C:\Users\...\Documents\git\vlang\vlib\glm\glm.v:254:31: warning: assignment to 'f32 *' {aka 'float *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  res[0] = 1
                               ^
C:\Users\...\Documents\git\vlang\vlib\glm\glm.v:255:31: warning: assignment to 'f32 *' {aka 'float *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  res[5] = 1
                               ^
C:\Users\...\Documents\git\vlang\vlib\glm\glm.v:256:32: warning: assignment to 'f32 *' {aka 'float *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  res[10] = 1
                                ^
C:\Users\...\Documents\git\vlang\vlib\glm\glm.v:261:32: warning: assignment to 'f32 *' {aka 'float *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  // # gl__Shader_set_mat4(shader, tos2("projection"), f) ;
                                ^
C:\Users\...\Documents\git\vlang\vlib\os\os.v: In function 'os__get_raw_line':
C:\Users\...\Documents\git\vlang\vlib\os\os.v:719:63: warning: passing argument 4 of 'ReadConsoleW' from incompatible pointer type [-Wincompatible-pointer-types]
    C.ReadConsole(h_input, buf, max_line_chars * 2, &bytes_read, 0)
                                                               ^~~~
In file included from C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/windows.h:74,
                 from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:541:
C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/wincon.h:258:114: note: expected 'LPDWORD' {aka 'long unsigned int *'} but argument is of type 'int *'
   WINBASEAPI WINBOOL WINAPI ReadConsoleW(HANDLE hConsoleInput,LPVOID lpBuffer,DWORD nNumberOfCharsToRead,LPDWORD lpNumberOfCharsRead,LPVOID lpReserved);
                                                                                                          ~~~~~~~~^~~~~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\os\os.v:725:52: warning: passing argument 4 of 'ReadFile' from incompatible pointer type [-Wincompatible-pointer-types]
    res := C.ReadFile(h_input, pos, 1, &bytes_read, 0)
                                                    ^~
In file included from C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/winbase.h:18,
                 from C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/windows.h:70,
                 from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:541:
C:/tools/mingw-w64/mingw32/i686-w64-mingw32/include/fileapi.h:167:106: note: expected 'LPDWORD' {aka 'long unsigned int *'} but argument is of type 'int *'
   WINBASEAPI WINBOOL WINAPI ReadFile (HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
                                                                                                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\gl\1shader.v: In function 'gl__new_shader':
C:\Users\...\Documents\git\vlang\vlib\gl\1shader.v:111:8: warning: variable 'dir' set but not used [-Wunused-but-set-variable]
  // Already have absolute path
        ^~~
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v: In function 'gl__init_glad':
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:15:11: warning: initialization of 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  ok := C.gladLoadGL()
           ^~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v: In function 'gl__shader_source':
C:\Users\...\Documents\git\vlang\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)
                                  ^~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:43:34: note: expected 'const GLchar * const*' {aka 'const char * const*'} but argument is of type 'byte **' {aka 'unsigned char **'}
C:\Users\...\Documents\git\vlang\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)
                                                   ^
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:43:51: note: expected 'const GLint *' {aka 'const int *'} but argument is of type 'int'
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v: In function 'gl__shader_info_log':
C:\Users\...\Documents\git\vlang\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)
                                             ^~~
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:77:45: note: expected 'GLchar *' {aka 'char *'} but argument is of type 'byte *' {aka 'unsigned char *'}
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v: In function 'gl__get_program_info_log':
C:\Users\...\Documents\git\vlang\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)
                                                ^~~
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:83:48: note: expected 'GLchar *' {aka 'char *'} but argument is of type 'byte *' {aka 'unsigned char *'}
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v: In function 'gl__draw_elements':
C:\Users\...\Documents\git\vlang\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)
                                           ^~
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:147:43: note: expected 'const void *' but argument is of type 'int'
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v: In function 'gl__vertex_attrib_pointer':
C:\Users\...\Documents\git\vlang\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)
                                                                          ^
C:\Users\...\Documents\git\vlang\vlib\gl\gl.v:177:74: note: expected 'const void *' but argument is of type 'int'
In file included from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:547:
C:\Users\...\Documents\git\vlang\vlib\glfw\glfw.v: In function 'glfw__set_cursor':
C:\Users\...\Documents\git\vlang\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
                                     ^~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\glfw\glfw.v:251:23: note: in expansion of macro 'GLFW_IBEAM_CURSOR'
  C.glfwSetCursor(0, C.GLFW_IBEAM_CURSOR)
                       ^~~~~~~~~~~~~~~~~
In file included from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:547:
C:\Users\...\Documents\git\vlang\thirdparty\glfw/GLFW/glfw3.h:4329:60: note: expected 'GLFWcursor *' {aka 'struct GLFWcursor *'} but argument is of type 'int'
 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
                                                ~~~~~~~~~~~~^~~~~~
In file included from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:547:
C:\Users\...\Documents\git\vlang\vlib\glfw\glfw.v: In function 'glfw__Window_set_cursor':
C:\Users\...\Documents\git\vlang\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
                                     ^~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\glfw\glfw.v:256:30: note: in expansion of macro 'GLFW_IBEAM_CURSOR'

                              ^
In file included from C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:547:
C:\Users\...\Documents\git\vlang\thirdparty\glfw/GLFW/glfw3.h:4329:60: note: expected 'GLFWcursor *' {aka 'struct GLFWcursor *'} but argument is of type 'int'
 GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
                                                ~~~~~~~~~~~~^~~~~~
C:\Users\...\Documents\git\vlang\vlib\glfw\glfw.v: In function 'glfw__get_monitor_size':
C:\Users\...\Documents\git\vlang\vlib\glfw\glfw.v:276:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  mode := C.glfwGetVideoMode(C.glfwGetPrimaryMonitor())
                    ^~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v: In function 'freetype__ft_load_char':
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v:138:23: warning: pointer targets in passing argument 2 of 'glad_glGenTextures' differ in signedness [-Wpointer-sign]
  C.glGenTextures(1, &texture)
                       ^~~~~~~
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v:138:23: note: expected 'GLuint *' {aka 'unsigned int *'} but argument is of type 'int *'
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v: In function 'freetype__new_context':
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v:195:12: warning: initialization of 'void *' from 'FT_Error' {aka 'int'} makes pointer from integer without a cast [-Wint-conversion]
  mut ret := C.FT_Init_FreeType(&ft)
            ^~~~~~~~~~~~~~~~
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v:215:7: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  ret = int(C.FT_New_Face(ft, font_path.str, 0, &face))
       ^
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v: In function 'freetype__FreeType_private_draw_text':
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v:316:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
    idx := _rune[0]
           ^
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v: In function 'freetype__FreeType_text_size':
C:\Users\...\Documents\git\vlang\vlib\freetype\freetype.v:412:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
    idx := _rune[0]
           ^
C:\Users\...\Documents\git\vlang: In function 'wWinMain':
C:\Users\...\Documents\git\vlang:3:44: warning: cast between incompatible function types from 'FARPROC' to 'WCHAR ** (__attribute__((stdcall)) *)(const WCHAR *, int *)' [-Wcast-function-type]
C:\Users\...\Documents\git\vlang:3:43: warning: passing argument 2 of 'os__init_os_args_wide' from incompatible pointer type [-Wincompatible-pointer-types]
C:\Users\...\Documents\git\vlang\vlib\os\os_windows.v:77:57: note: expected 'unsigned char **' but argument is of type 'wchar_t **' {aka 'short unsigned int **'}
 fn init_os_args_wide(argc int, argv &byteptr) []string {
                                                ~~~~~~~~~^
C:\Users\...\Documents\git\vlang\vlib\builtin\array.v: In function 'main__main':
C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:154:72: warning: 'game' is used uninitialized in this function [-Wuninitialized]
  }
                                                                        ^
C:\Users\...\Documents\git\vlang\examples\tetris\tetris.v:154:7: note: 'game' was declared here
  }
       ^
C:\Users\...\AppData\Local\Temp\ccT26e1E.o: In function `freetype__ft_load_char':
C:/Users/.../Documents/git/vlang/vlib/freetype/freetype.v:130: undefined reference to `FT_Load_Char'
C:\Users\...\AppData\Local\Temp\ccT26e1E.o: In function `freetype__new_context':
C:/Users/.../Documents/git/vlang/vlib/freetype/freetype.v:195: undefined reference to `FT_Init_FreeType'
C:/Users/.../Documents/git/vlang/vlib/freetype/freetype.v:215: undefined reference to `FT_New_Face'
C:/Users/.../Documents/git/vlang/vlib/freetype/freetype.v:222: undefined reference to `FT_Set_Pixel_Sizes'
collect2.exe: 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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

PavelVozenilek picture PavelVozenilek  路  3Comments

oleg-kachan picture oleg-kachan  路  3Comments

cjmxp picture cjmxp  路  3Comments

choleraehyq picture choleraehyq  路  3Comments

arg2das picture arg2das  路  3Comments