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

error: linking with link.exe failed: exit code: 1120 #99

Closed
mildcwen opened this issue Jan 11, 2021 · 8 comments
Closed

error: linking with link.exe failed: exit code: 1120 #99

mildcwen opened this issue Jan 11, 2021 · 8 comments

Comments

@mildcwen
Copy link

mildcwen commented Jan 11, 2021

I could build shaderc-rs,
Compiling cc v1.0.66
Compiling libc v0.2.82
Compiling cmake v0.1.45
Compiling shaderc-sys v0.7.0 (D:\Code\rust\shaderc-rs\shaderc-sys)
warning: shaderc: searching native shaderc libraries in 'D:\Code\build\libshaderc\Release'
warning: shaderc: Windows MSVC static build is experimental

but could not complie Project.
lib-dir

What's this error?

@antiagainst
Copy link
Collaborator

Hi @mildcwen, could you provide more details? Like the verbose output of failing to compile your project?

@mildcwen
Copy link
Author

mildcwen commented Jan 12, 2021

@antiagainst thanks for reply. I'm studying for Vulkan and I want use vk-shader-macros , but couldn't compile. So i new project just use shaderc. and copy it's Example Only! and error message is too long ....
-------------------
I have build from Source again. ..and again.....
error LNK2019( the major message)

= note: Non-UTF-8 output: libshaderc-37bb496e57e67982.rlib(shaderc-37bb496e57e67982.shaderc.5iq9nx3y-cgu.0.rcgu.o) : error LNK2019: \xce\xde\xb7\xa8\xbd\xe2\xce\xf6\xb5\xc4\xcd\xe2\xb2\xbf\xb7\xfb\xba\xc5

There are some similarities to Issues #80 but don't have tip information..
--------Maybe I only selected to upload the ".spv" file....sad!

@antiagainst
Copy link
Collaborator

Hi @mildcwen, the error looks like something related to language/locale settings in Rust itself. See rust-lang/rust#35785. I'm using English as my primary language on Windows. It works fine for me to cargo test in a newly checked out vk-shader-macros.

Besides, you can try to use v0.7.0, which can detect Vulkan SDK and use the shaderc libraries there directly (if you have VULKAN_SDK environment set) so you don't need to manually download and specify the shaderc location.

@mildcwen
Copy link
Author

mildcwen commented Jan 16, 2021

@antiagainst first, I've installed Vulkan SDK, and get the same error as before.
and i follow the answer of 「crlf0710 」, I modify VS'LANG to English,
then appear this

= note: libshaderc-37bb496e57e67982.rlib(shaderc-37bb496e57e67982.shaderc.5iq9nx3y-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol shaderc_compiler_initialize referenced in function _ZN7shaderc8Compiler3new17ha016f1c6249e5b8aE

The next I uninstall [Visual C++ 2015, 2013, VS2015 X64 Native Tools Command(VC++ Build Tools)],just stay 2017 (it's only English )on PC.
Finally Error.

error LNK2019: unresolved external symbol shaderc_parse_version_profile referenced in function _ZN7shaderc21parse_version_profile17hff3b319b261982f0E
D:\Code\build\libshaderc\Release\shaderc_shared.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
D:\Code\rust\chun\target\debug\deps\chun.exe : fatal error LNK1120: 38 unresolved externals


I look the message found still use SHADERC_LIB_DIR, then delete it and restart PC, and compile ,all Fine.

@mildcwen
Copy link
Author

mildcwen commented Jan 16, 2021

@antiagainst , Thank you very much. I've solved this trouble...ha-ha.
I think install Vulkan SDK is much easier than Build from google-shaderc. and thank you again...
(So maybe could write in README? there are too issue since build source...)

please close this issue.
Thank you again for your help!
大佬....感謝!

@mildcwen
Copy link
Author

mildcwen commented Jan 16, 2021

@antiagainst
May I ask you another question? (....I konw it's not relevant.., and I promise this is last one comment.)
I've installed Vulkan SDK. ,but since Coding in Rust instead of c++..
Error: Layer specified does not exist .So i want to know how do you call the sdk..
Because i want to use VkLayer_khronos_validation.dll etc..i'm not sure which is ...
I just want to enable Validation Layer to debug with validation layer.(before not use...)

--
I heard this also could debug..But I can't use it
QQ截图23225106

@antiagainst
Copy link
Collaborator

The Vulkan Configurator GUI is something new that I haven't tried out. I typically use CLI environment variables to force layers on. I think you can use VK_LAYER_PATH to point to the layer installation location (might be unnecessary if you installed it to a standard location) and then use VK_INSTANCE_LAYERS to enable certain layers. You may also want to set VK_LOADER_DEBUG=all to see verbose output from Vulkan loader to verify things work. You can find more details here: https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#table-of-debug-environment-variables

@mildcwen
Copy link
Author

There's no need to reply.
Since it's myself problem ..I'm not going to comment any more

Thank you very much for your help!

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

No branches or pull requests

2 participants