V: compile error IID_ID3D11Texture2D

Created on 7 Aug 2020  ·  6Comments  ·  Source: vlang/v

V 0.1.29
Windows 10 64 bits

I'm trying compile codes with 'GUI';
I'm using Mingw64

[Running] v run "c:\v\examples\tetris\tetris.v"
vlib\gg\gg.v:6:8: warning: module 'os' is imported but never used
    4 | 
    5 | import gx
    6 | import os
      |        ~~
    7 | import sokol
    8 | import sokol.sapp
vlib\gg\image.v:5:8: warning: module 'gx' is imported but never used
    3 | module gg
    4 | 
    5 | import gx
      |        ~~
    6 | import os
    7 | import sokol
vlib\gg\image.v:8:8: warning: module 'sapp (sokol.sapp)' is imported but never used
    6 | import os
    7 | import sokol
    8 | import sokol.sapp
      |        ~~~~~
    9 | import sokol.sgl
   10 | import sokol.gfx
vlib\gg\image.v:10:8: warning: module 'gfx (sokol.gfx)' is imported but never used
    8 | import sokol.sapp
    9 | import sokol.sgl
   10 | import sokol.gfx
      |        ~~~~~
   11 | import stbi
   12 |
==================
C:\Users\MATHEU~1\AppData\Local\Temp\ccT9TyvN.o:tetris.tmp.c:(.rdata$.refptr.IID_ID3D11Texture2D[.refptr.IID_ID3D11Texture2D]+0x0): undefined reference to 'IID_ID3D11Texture2D'
collect2.exe: error: ld returned 1 exit status
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

If you were not working with C interop, please raise an issue on GitHub:

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang


[Done] exited with code=1 in 3.015 seconds

The ui examples don't compile, same error

Bug

All 6 comments

I fix this, using opengl (temporary solution)

vlib/sokol/c/declaration.c.v

#flag windows -DSOKOL_GLCORE33
// #flag windows -DSOKOL_D3D11

I fix this, using opengl (temporary solution)

vlib/sokol/c/declaration.c.v

#flag windows -DSOKOL_GLCORE33
// #flag windows -DSOKOL_D3D11

thanks .. i'm using the workaround too :-)

when i run 'v run users.v' throw same exception.I think its not my c environment problem

Dong@DESKTOP-JHQSG53 MINGW64 /c/Users/Dong/.vmodules/ui/examples
# v run users.v
C:\v\vlib\clipboard\clipboard_windows.c.v:136:15: warning: pointer indexing is only allowed in `unsafe` blocks
  134 |         mut locked := &u16(C.GlobalLock(buf))
  135 |         C.MultiByteToWideChar(C.CP_UTF8, C.MB_ERR_INVALID_CHARS, text.str, text.len + 1, locked, len_required)
  136 |         locked[len_required - 1] = u16(0)
      |               ~~~~~~~~~~~~~~~~~~
  137 |         C.GlobalUnlock(buf)
  138 |     }
==================
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccRBOhUv.o:users.tmp.c:(.rdata$.refptr.IID_ID3D11Texture2D[.refptr.IID_ID3D11Texture2D]+0x0): undefined reference to `IID_ID3D11Texture2D'
collect2.exe: error: ld returned 1 exit status
...
==================
(Use `v -cg` to print the entire error message)

builder error:
==================
C error. This should never happen.

If you were not working with C interop, please raise an issue on GitHub:

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang


Dong@DESKTOP-JHQSG53 MINGW64 /c/Users/Dong/.vmodules/ui/examples
# gcc --version
gcc.exe (Rev3, Built by MSYS2 project) 10.1.0
Copyright (C) 2020 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.


Dong@DESKTOP-JHQSG53 MINGW64 /c/Users/Dong/.vmodules/ui/examples
# make --version
GNU Make 4.3
为 x86_64-pc-msys 编译
Copyright (C) 1988-2020 Free Software Foundation, Inc.
许可证:GPLv3+:GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/gpl.html>。
本软件是自由软件:您可以自由修改和重新发布它。
在法律允许的范围内没有其他保证。

Dong@DESKTOP-JHQSG53 MINGW64 /c/Users/Dong/.vmodules/ui/examples
#

V 0.1.29 c01fd4a
gcc (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project) 8.1.0
windows 10 version 2004(19041.450)

From current git
C:\Users\ghs\AppData\Local\Temp\ccNSVk8i.o:tetris.tmp.c:(.rdata$.refptr.IID_ID3D
11Texture2D[.refptr.IID_ID3D11Texture2D]+0x0): undefined reference to `IID_ID3D1
1Texture2D'
collect2.exe: error: ld returned 1 exit status

using #flag windows -DSOKOL_GLCORE33

C:\PortableApps\v\thirdparty\sokol/sokol_gfx.h: In function '_sg_validate_pipeline_desc':
C:\PortableApps\v\thirdparty\sokol/sokol_gfx.h:10221:66: error: '_sg_shader_attr_t' {aka 'const struct '} has no member named 'sem_name'; did you mean 'name'?
SOKOL_VALIDATE(!_sg_strempty(&shd->attrs[attr_index].sem_name), _SG_VALIDATE_PIPELINEDESC_ATTR_SEMANTICS);
^~~~
C:\PortableApps\v\thirdparty\sokol/sokol_gfx.h:2116:53: note: in definition of macro 'SOKOL_VALIDATE'
#define SOKOL_VALIDATE(cond, err) _sg_validate((cond), err)
^~
In file included from C:\Users\ghs\AppData\Local\Temp\v\tetris.tmp.c:534:
C:\PortableApps\v\thirdparty\sokol/util/sokol_gl.h: In function 'sgl_setup':
C:\PortableApps\v\thirdparty\sokol/util/sokol_gl.h:1832:33: error: '_sgl_vs_bin' undeclared (first use in this function); did you mean '_sgl_vs_src'?
shd_desc.vs.byte_code = _sgl_vs_bin;
^
~~~~

Make the change suggested by @matheusnervis and tetris compiles and runs fine on Windows.

@medvednikov can we make this change until everything is working with D3D?

Yes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PavelVozenilek picture PavelVozenilek  ·  3Comments

radare picture radare  ·  3Comments

taojy123 picture taojy123  ·  3Comments

oleg-kachan picture oleg-kachan  ·  3Comments

markgraydev picture markgraydev  ·  3Comments