src\out\Default\obj\api\media_stream_interface.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2F4

550 views
Skip to first unread message

Điền Đô

unread,
Sep 22, 2023, 3:53:44 AM9/22/23
to discuss-webrtc
Hi guy,

I built webrtc with command line:"gn gen out/Default --ide=vs2022"
I tested the sample application and it was successful, but when I link the ".lib" static library files, I always get the error "fatal error LNK1107: invalid or corrupt file: cannot read at 0x000" with the path library file.

What is the solution to this problem?

And one more question, I tried to remove clang from the library so I tried running: 
"gn gen out/Default --ide=vs2022 --args="is_clang=false""
and it seems that when removing clang, the system will automatically build with c++17, and the webrtc library requires c++20 so I get the error: "error C7555: use of designated initializers requires at least '/std:c++20'"

Is my guess correct?
Any suggestions for my problems I sincerely appreciate :))

V I

unread,
Sep 22, 2023, 5:35:37 AM9/22/23
to discuss...@googlegroups.com
It's not recommended to disable Clang, i.e. build with MSVC compiler. MSVC build has been broken for years, the easiest way around it is to switch to Clang completely - I mean the app you develop should be built with Clang, not MSVC

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/7f6e296f-1fe8-4eda-a3ac-56591f31031fn%40googlegroups.com.

Muhammad Usman Bashir

unread,
Sep 22, 2023, 7:13:40 AM9/22/23
to discuss-webrtc
@Điền Đô, you can use the following commands to build ' webrtc.lib ' without Clang, but as mentioned above, it is not recommended. I was able to run the webrtc.lib and debug webrtc stack on windows machine.

gn gen --ide=vs2019 out/Default --args="use_rtti=true is_clang=false rtc_build_tools=false rtc_include_tests=false rtc_build_examples=false"

ninja -C out\Default\x64

You can visit the following link for more details. 

WebRTC compilation & debugging

Điền Đô

unread,
Sep 23, 2023, 12:51:14 PM9/23/23
to discuss-webrtc
Hi  V I
Thanks for your response :))

I'm using Qt as an interface, and Qt in Visual Studio depends on MSVC.  Error that I receive:
"out\Default\obj\api\create_peerconnection_factory.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x0000"
Is it because of MSVC?

If the problem is truly MSVC, I can still build my project into a library, then I will use the code I wrote in my Qt interface.
Besides this, is there any other way for me to fix it? Because building a traditional project is still less complicated.

Looking forward to your response.
Once again, I sincerely thank you:))
Vào lúc 16:35:37 UTC+7 ngày Thứ Sáu, 22 tháng 9, 2023, V I đã viết:

Điền Đô

unread,
Sep 24, 2023, 4:01:29 AM9/24/23
to discuss-webrtc
Hi Muhammad Usman Bashir
I sent you a response with "V I" but it didn't post at the same time.
I tried rebuilding the library with your code but I still get the error: "error C7555: use of designated initializers requires at least '/std:c++20'"
As shown in the pic, I guess it is running using c++17.

Do you have any suggestions for me?
383361459_824551349151758_1282694923313532264_n.png
Vào lúc 18:13:40 UTC+7 ngày Thứ Sáu, 22 tháng 9, 2023, Muhammad Usman Bashir đã viết:

Điền Đô

unread,
Sep 24, 2023, 4:05:41 AM9/24/23
to discuss-webrtc
Hi Muhammad Usman Bashir
Can you connect with me? Communicating via groups.google takes a lot of time:((


Vào lúc 18:13:40 UTC+7 ngày Thứ Sáu, 22 tháng 9, 2023, Muhammad Usman Bashir đã viết:
@Điền Đô, you can use the following commands to build ' webrtc.lib ' without Clang, but as mentioned above, it is not recommended. I was able to run the webrtc.lib and debug webrtc stack on windows machine.

Điền Đô

unread,
Oct 2, 2023, 5:00:41 AM10/2/23
to discuss-webrtc
Hi all.

I fixed the error " "fatal error LNK1107: invalid or corrupt file: cannot read at 0x000" " when linking to .lib files by changing the compiler.
Specifically I was using MSVC and got that error, when I changed to clang compiler and the error was fixed.

Hopefully someone will need it in the future:))

Vào lúc 14:53:44 UTC+7 ngày Thứ Sáu, 22 tháng 9, 2023, Điền Đô đã viết:

Điền Đô

unread,
Oct 2, 2023, 5:35:38 AM10/2/23
to discuss-webrtc
Hi guys.

I have one more problem.
In my search results, I know that "libc++ llvm-clang" is the default library for webrtc builds.
It is represented as " std::__1::  " ( __1  is the inline namespace that libc++ uses)

As shown below, I am getting the error:
"undefined symbol: public: class std::Cr::basic_string<char, struct std::Cr::char_traits<char>, class std::Cr::allocator<char>> & __cdecl std::Cr::basic_string<char, struct std::Cr::char_traits<char>, class std::Cr::allocator<char>>::append(char const *, unsigned __int64)"
std::Cr::"  is the inline namespace the library is using, what parameters do I have to rebuild the library with, or is there any way to fix this error.

386472116_1538227523378905_9216581253869388749_n.png 



Vào lúc 16:00:41 UTC+7 ngày Thứ Hai, 2 tháng 10, 2023, Điền Đô đã viết:

Điền Võ Bá

unread,
Nov 1, 2023, 2:00:47 AM11/1/23
to discuss-webrtc
I successfully fixed this error with the following:

gn gen out/Default --args="is_debug=true rtc_use_h264=true is_component_ffmpeg=true ffmpeg_branding=\"Chrome\" enable_libaom=false gtest_enable_absl_printers=false libyuv_include_tests=false rtc_include_tests=false is_component_build=false rtc_enable_protobuf=true use_custom_libcxx=false use_custom_libcxx_for_host=false use_rtti=true treat_warnings_as_errors=false dcheck_always_on true"

Vào lúc 16:35:38 UTC+7 ngày Thứ Hai, 2 tháng 10, 2023, Điền Đô đã viết:
Reply all
Reply to author
Forward
0 new messages