Go-sfml已经被弃用。

huangapple go评论89阅读模式
英文:

Go-sfml `` is deprecated

问题

我在我的环境中设置了sfmlcsfml,然后尝试安装go-sfml,但是返回了大量的弃用警告。我认为我安装了正确的sfml版本,所以不知道出了什么问题或者如何修复。

我使用winbuilds来设置gcc

我做了以下操作:

go get -u gopkg.in/teh-cmc/go-sfml.v24/...

返回多个警告,例如:

Graphics_wrap.c:6614:3: warning: 'sfShader_setCurrentTextureParameter' is deprecated (declared at c:\users\****\documents\winbuilds\x86_64-w64-mingw32\include\sfml\graphics\shader.h:646) [-Wdeprecated-declarations]
   sfShader_setCurrentTextureParameter(arg1,(char const *)arg2); 

它还无法安装/构建(至少我认为它是在说这个):

C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
c:/users/****/documents/winbuilds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: unrecognized option '--high-entropy-va'
c:/users/****/documents/winbuilds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status```


<details>
<summary>英文:</summary>

I set up `sfml` and `csfml` in my environment and then tried installing `go-sfml`, which started returning tons of deprecation warnings. I think I have the right `sfml` versions, so I don&#39;t know what is wrong or how to fix it.

I used `winbuilds` to set up `gcc`.

What I did:

```go get -u  gopkg.in/teh-cmc/go-sfml.v24/...```

Returns multiple warnings like:
```Graphics_wrap.c: In function &#39;_wrap_sfShader_setCurrentTextureParameter_graphics_23698568018502eb&#39;:
Graphics_wrap.c:6614:3: warning: &#39;sfShader_setCurrentTextureParameter&#39; is deprecated (declared at c:\users\****\documents\winbuilds\x86_64-w64-mingw32\include\sfml\graphics\shader.h:646) [-Wdeprecated-declarations]
   sfShader_setCurrentTextureParameter(arg1,(char const *)arg2); 

It also fails to install/build (at least I think that is what it is saying):

C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
c:/users/****/documents/winbuilds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: unrecognized option &#39;--high-entropy-va&#39;
c:/users/****/documents/winbuilds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status```

</details>


# 答案1
**得分**: 1

&gt; 所以我以为那就是问题所在,然后改变了版本。

但是这在 [commit 16ea259][1] 中已经被弃用了,时间是2016年8月,CSFML 2.4

由于 [`teh-cmc/go-sfml`][2]:

- 需要 CSFML 2.4,
- 在 `graphics/Graphics_wrap.c` 中使用了 [`sfShader_setCurrentTextureParameter`][3]

除非你修补 `go-sfml` 本身,否则你将始终收到该警告。


  [1]: https://github.com/SFML/CSFML/commit/16ea259e04a1a946f0a7655ce5c2acc3d04c430f#diff-eda6e32a6d1dd56b4ce07bd5274278f421b2d045ab21c931c4992fa171a96589R619-R645
  [2]: https://github.com/teh-cmc/go-sfml
  [3]: https://github.com/teh-cmc/go-sfml/blob/25d755527155cc9e90830e6dc3e8fc78c90e4868/graphics/Graphics_wrap.c#L6603-L6614

<details>
<summary>英文:</summary>

&gt;  so I thought that was what was wrong and changed the version.

But this was deprecated in [commit 16ea259][1], Aug. 2016, CSFML 2.4

Since [`teh-cmc/go-sfml`][2]:

- does require CSFML 2.4, 
- does use [`sfShader_setCurrentTextureParameter` in `graphics/Graphics_wrap.c`][3]

You always will have that warning, unless you patch `go-sfml` itself.


  [1]: https://github.com/SFML/CSFML/commit/16ea259e04a1a946f0a7655ce5c2acc3d04c430f#diff-eda6e32a6d1dd56b4ce07bd5274278f421b2d045ab21c931c4992fa171a96589R619-R645
  [2]: https://github.com/teh-cmc/go-sfml
  [3]: https://github.com/teh-cmc/go-sfml/blob/25d755527155cc9e90830e6dc3e8fc78c90e4868/graphics/Graphics_wrap.c#L6603-L6614

</details>



huangapple
  • 本文由 发表于 2021年7月21日 01:40:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/68459217.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定