-
Notifications
You must be signed in to change notification settings - Fork 11
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
Librashader.lib not being compiled as static #20
Comments
librashader-reflect uses https://github.com/google/shaderc-rs which builds as dynamic by default. You could try enabling the If that doesn't work you'll have to do some digging. librashader is designed to be linked dynamically with |
It doesn't compile anymore after making reflect standalone. Compiling librashader-runtime-vk v0.1.4 (C:\msys64\librashader\librashader-runtime-vk) error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound error[E0277]: the trait bound For more information about this error, try |
Are you using the nightly compiler? |
Yes. It compiles fine if I don't try to build it static MT. |
Is there a pressing reason why you need a static build and can’t use
librashader_ld.h?
…On Mon, Oct 9, 2023 at 12:44 PM star69rem ***@***.***> wrote:
Yes. It compiles fine if I don't try to build it static MT.
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHUIN3FT7VUFVBACJ774NDX6QSWNAVCNFSM6AAAAAA5YKP742VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJTGMZTSNBQHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
If there wasn't I wouldn't be going through this BDSM. |
I'm going to need to know more about your use case as to why the supported headers aren't a valid option. |
I don't want users to have to install the C++ Redistributables. Thanks! |
While I honestly don’t think it’s worth the trouble of static linking just to avoid installing the C++ redistributables (especially since librashader_ld.h means that the librashader version is user-upgradable: it’s very unlikely the ABI will change at this point), I can look into this for you; just in the middle of a move right now so it’ll be some time until I can get set up again. |
I would appreciate it but there's no rush. I just keep running into people who get tripped up by the redistributables and I would really prefer to not have to package a whole installer for it. Thanks again! |
looks like I'll need this, will need to wait until the next shaderc release to get this working. |
Could you check if shaderc links properly as of 2bd6f8f? |
Publishing librashader |
Get this error: 3>lld-link : error : /failifmismatch: mismatch detected for 'RuntimeLibrary': |
Output from shaderc-sys build: |
I got it to compile by just moving the shaderc libs out of the vulkan SDK folder. |
Still having one problem: it all works if it's using the optimized profile, but using the debug profile doesn't work because it seems like some stuff is still being compiled in release mode. So it seems like the debug setting isn't being passed to all dependencies? |
2>>>> libcpmtd.lib(xstoull.obj) has value 2 xstoull.obj for some reason is in release |
I tried the recommendation to set the environment variables: SET CXXFLAGS=-MTd SET CFLAGS=-MTd Now it fails on xstrxfrm.obj instead of xstoull.obj. 1>>>> libcpmtd.lib(xstrxfrm.obj) has value 2 |
I'm honestly not sure where libcpmtd.lib is coming from. Maybe spirv-to-dxil-rs? Does it build without |
I looked into it a bit, and apparently this is a known issue with rust's libc being hardcoded to compile with a release flag. I'm not even sure there's anything you can do. Seems like it's been an issue for years. I worked around it by just throwing in some preprocessor definitions to use the DLL for debug mode and the static linking for the release build. Not ideal, but it works. Stuff like this is why I think there's going to be so much friction actually getting your program into emulators. Emulator authors tend to be OCD nutjobs and stuff like this is going to drive them crazy. They all want to rule their own little world with statically linked everything. |
Closing as resolved. |
I'm not able to link librashader.lib with a Visual Studio project with MT_StaticRelease.
I get the following error when setting the crt-static environment variable (SET RUSTFLAGS=-Ctarget-feature=+crt-static):
librashader.lib(wrapper.o) has value MT_StaticRelease
librashader.lib(shaderc.obj) has value MD_DynamicRelease
Is some librashader dependency dynamic or something?
The text was updated successfully, but these errors were encountered: