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

fix x264 on windows with shared build #5344

Closed

Conversation

SnowinterCat
Copy link
Contributor

When x264 compiles dynamic libraries on Windows platform, it will generate libx264.dll.lib (msvc) or libx264.dll.a (mingw) import libraries.
However, configue has hardcoded -lx264 when generating x264.pc, so that libraries using pkgconfig can't find the symbols when linking x264 libraries.
Change the import library to libx264.lib (msvc) or libx264.a (mingw).

@SnowinterCat
Copy link
Contributor Author

Although mingw64 recognises xxx.a and xxx.lib.a as import libraries, mingw32 only recognises xxx.lib.a as an import library. Therefore, only modify the generated msvc import library, not the mingw

@SnowinterCat
Copy link
Contributor Author

@star-hengxing 这个应该是没问题的,我试了删掉我的修改,发现以前的能过CI是mingw32的测试并没有执行test,仅仅是安装了mingw32。另外我试着打印x264的config.log发现x264在尝试使用-m64来测试,导致失败。出现找不到 c compiler的报错

@Issues-translate-bot
Copy link

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


@star-hengxing This should be no problem. I tried deleting my modifications and found that the previous test that could pass CI was mingw32 and did not execute the test, but only installed mingw32. In addition, I tried to print the config.log of x264 and found that x264 was trying to use -m64 to test, causing failure. An error message that the c compiler cannot be found appears.

@star-hengxing
Copy link
Contributor

mingw32 的问题大概是 xmake bug。
triples: host -> windows & mingw -> plat & arch == i386
但 xmake 认为不是交叉编译,没有传 --host= 进去导致报错。
@waruqi

在我的 pr 中,手动传 host 进去就没问题了

@Issues-translate-bot
Copy link

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


The problem with mingw32 is probably an xmake bug.
triples: host -> windows & mingw -> plat & arch == i386
However, xmake thinks it is not cross-compilation, and does not pass --host=, causing an error.
@waruqi

In my PR, there is no problem if I manually pass the host into it.

@waruqi
Copy link
Member

waruqi commented Sep 27, 2024

xmake-io/xmake#5671

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

Successfully merging this pull request may close these issues.

4 participants