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

yy-thunks包的一些问题 #5728

Open
heheda123123 opened this issue Nov 11, 2024 · 5 comments
Open

yy-thunks包的一些问题 #5728

heheda123123 opened this issue Nov 11, 2024 · 5 comments
Labels

Comments

@heheda123123
Copy link
Contributor

heheda123123 commented Nov 11, 2024

Xmake 版本

latest

操作系统版本和架构

windows 11

描述问题

有两个问题
1 下载链接发生了改变
https://github.com/Chuyu-Team/YY-Thunks/releases
从1.0.9之后下载链接变成了

https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.1.1/YY-Thunks-1.1.1-Lib.zip
https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.1.1/YY-Thunks-1.1.1-Objs.zip

之前xmake.lua里面用的已经不存在了,没法自动更新

https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.1.4/YY-Thunks-1.1.4-Binary.zip

2 现在的包设置了兼容xp但是没有生效
复现过程,创建一个项目

xmake create -l c++ -P testyy

修改xmake.lua

add_rules("mode.debug", "mode.release")
add_requires("yy-thunks")

target("testyy")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("yy-thunks")
    add_rules("@yy-thunks/xp")

构建

xmake f -c -a x86
xmake

放到xp上运行会提示不是有效的win32程序

按照yy-thunks文档的说法,https://github.com/Chuyu-Team/YY-Thunks/blob/master/Readme.osc.md
原因可能有两个,一是没有把obj放到系统sdk之前,二是没有设置“所需的最低版本”

期待的结果

1

工程配置

1

附加信息和错误日志

1

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Xmake version

latest

Operating system version and architecture

Windows 11

Describe the problem

https://github.com/Chuyu-Team/YY-Thunks/releases
After 1.0.9, the download link becomes

https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.1.1/YY-Thunks-1.1.1-Lib.zip
https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.1.1/YY-Thunks-1.1.1-Objs.zip

The one used in xmake.lua no longer exists and cannot be updated automatically.

https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.1.4/YY-Thunks-1.1.4-Binary.zip

Expected results

1

Project configuration

1

Additional information and error logs

1

@heheda123123 heheda123123 changed the title yy-thunks新版本release的方式变了 yy-thunks包的一些问题 Nov 11, 2024
@heheda123123
Copy link
Contributor Author

heheda123123 commented Nov 11, 2024

对于模板c++项目,额外加一个add_ldflags("/SUBSYSTEM:CONSOLE,5.01")就可以了
但是我自己的项目按照这个方法,加了之后会出现其他错误
可能是链接顺序的问题,但是add_linkorders不能对obj文件生效,咋处理呢

checking for C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\bin\HostX64\x86\link.exe ... ok
checking for flags (/SUBSYSTEM:CONSOLE,5.01) ... no
> link.exe "/SUBSYSTEM:CONSOLE,5.01" "-nologo" "-dynamicbase" "-nxcompat" "-machine:x86"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: C:\Users\ADMINI~1\AppData\Local\Temp\.xmake\241111\_427933EB8CA440208DF99028CB6F6B30.obj : fatal error LNK1112: 模块计算机类型“x64”与目标计算机类型“x86”冲突

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\link\has_flags.lua:28]:
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\bin\HostX64\x86\cl.exe
checking for the c compiler (cc) ... cl.exe

build cache stats:
cache directory: build\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s

[100%]: build ok, spent 0.766s
warning: add_ldflags("/SUBSYSTEM:CONSOLE,5.01") is ignored, please pass `{force = true}` or call `set_policy("check.auto_ignore_flags", false)` if you want to set it.
PS C:\Users\Administrator\code\letsgo>

@heheda123123
Copy link
Contributor Author

heheda123123 commented Nov 11, 2024

我后面的新问题解决了,但是是手动去链接obj,再给设置子系统这句加上{force = true}

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


My new question later is to manually link obj and then forcibly add {force = true}

@star-hengxing
Copy link
Contributor

#5730

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

No branches or pull requests

3 participants