Tdesktop: [Question] Compilation error (Windows, MSVC 2019)

Created on 26 May 2020  ·  14Comments  ·  Source: telegramdesktop/tdesktop

Hi!

I am trying to compile Telegram using this guide: https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-msvc.md. I have generated the .sln file. but I get ~700 errors when I am trying to build the solution in Debug mode with Visual Studio.

The first error is

Error   C2039   'result_of': is not a member of 'std' (compiling source file C:\tdesktop-build\tdesktop\Telegram\ThirdParty\libtgvoip\EchoCanceller.cpp)    lib_tgvoip  C:\tdesktop-build\tdesktop\Telegram\ThirdParty\libtgvoip\webrtc_dsp\absl\meta\type_traits.h 413 

Also, during build I get 3 message boxes like this:

---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Debug Assertion Failed!

Program: ...ktop\out\Telegram\codegen\codegen\lang\Debug\codegen_lang.exe
File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp
Line: 904

Expression: _CrtIsValidHeapPointer(block)

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)

---------------------------
Abort   Retry   Ignore   
---------------------------

Can someone please give me some directions? Is there perhaps a different place to seek help with compilation? Building C++ project, especially a failrly large one like Telegram, is known to be a problematic process, so I am surprised not to see hundreds of similar questions here.

question

Most helpful comment

After latest commit (793906c) I've got debug assertion errors on debug configuration:

errors
debug_errors

And some errors in vs ~20.
Hope these screenshots will help to find reason because I can't find it

P.S. in Release configuration everything is good

All 14 comments

@earshinov I didn't deploy fixes for build on msvc 16.6.0 yet. Although I didn't see that Debug Assertion Violation.

Thanks for a prompt reply! I will wait for build fixes then.

I get the same problem today, did you solve the problem?

@TeleFan777 I suppose you need to do following things:

  1. Roll back vs to 16.5.0
  2. checkout to 8d1db85 commit (or maybe some different. Last worked commit for me was at 20 of may)
  3. checkout all submodules to status that was at 8d1db85 commit
  4. reconfigure and rebuild project

or

just wait while @john-preston or someone else will fix this issue

After latest commit (793906c) I've got debug assertion errors on debug configuration:

errors
debug_errors

And some errors in vs ~20.
Hope these screenshots will help to find reason because I can't find it

P.S. in Release configuration everything is good

Exactly same problem here with debug build. V.S. 16.6.1.

image

I also encountered the same problem, how to solve?

@wxz879526 This is a regression in Visual Studio :(

You can try Visual Studio Preview 16.7.* (they say it is fixed there), or downgrade to Visual Studio 16.5.* (you'll need to update cmake_helpers submodule to the latest commit, where I've reverted workarounds for 16.6.*).

Dear administrator. When I compile, I report the following error. I want to find a solution.

TBuildtdesktopTelegramlib_ uiui/effects/cross_ Animation. H (9,1): fatal error C1083: could not open include file: 'styles / style_ widgets.h”: No such file or directory

C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(231,5): error MSB6006: “cmd.exe” Exited with code 1.

image
still no fix? Version 16.6.3

you need 16.7 preview or old 16.5 studio

you need 16.7 preview or old 16.5 studio

omg, when i'm installing preview studio it's also requires me installing gigabytes of sdk's and other tools... i guess i have to wait

Using VS2019 16.5.0 can solve the above problems.
Its download link is https://docs.microsoft.com/en-us/visualstudio/releases/2019/history

Why closed it? Downgrading is not a solution

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liudvikas picture Liudvikas  ·  3Comments

matteotumiati picture matteotumiati  ·  3Comments

Yanrishatum picture Yanrishatum  ·  3Comments

TheAppService picture TheAppService  ·  3Comments

beppe9000 picture beppe9000  ·  3Comments