View Issue Details

IDProjectCategoryView StatusLast Update
0032986Open CASCADEOCCT:Samplespublic2023-03-19 20:18
ReporterafokinAssigned Toddzama 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2022 
Product Version7.7.0 
Target Version7.7.0Fixed in Version7.7.0 
Summary0032986: Samples - csharp sample is crashed on compilation with VC++ 2022
DescriptionWhile demanding c++ language standard c++20, the error of OCCTProxy compilation is occured:

Rebuild started...
1>------ Rebuild All started: Project: OCCTProxy, Configuration: Release x64 ------
1>OCCTProxy.cpp
1>c1xx : warning C4857: C++/CLI mode does not support C++ versions newer than C++17; setting language to /std:c++17
1>c1xx : error C7681: two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase-
1>c1xx : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>Done building project "OCCTProxy.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Officially, C++/CLI mode does not support C++ version newer than C++17, so we should not demand C++20 to compile csharp samples.
Alternative solution - using /permissive (ConformanceMode = false), rather than default value /permissive- (ConformanceMode = true)
option to compile OCCTProxy. But alternative solution has been denied.
So, here is nothing to do to fix compilation of OCCTProxy project.

Nevertheless, error occures in IE_WPF_WinForms and IE_WinForms - if we trying to compile with VC++ 2022 (not demanding c++20):
Build started...
1>------ Build started: Project: OCCTProxy, Configuration: Release x64 ------
1>OCCTProxy.cpp
1>.NETFramework,Version=v4.7.2.AssemblyAttributes.cpp
1>   Creating library ..\win64\vc143\bin\OCCTProxy.lib and object ..\win64\vc143\bin\OCCTProxy.exp
1>OCCTProxy.vcxproj -> d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\win64\vc143\bin\OCCTProxy.dll
2>------ Build started: Project: IE_WPF_WinForms, Configuration: Release x64 ------
2>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2302,5):
warning MSB3274:
The primary reference
"d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\win64\vc143\bin\OCCTProxy.dll"
could not be resolved because it was built against the ".NETFramework,Version=v4.7.2" framework.
This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
2>d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\WPF_WinForms\OCCViewer.cs(60,16,60,25):
error CS0246:
The type or namespace name 'OCCTProxy' could not be found (are you missing a using directive or an assembly reference?)
2>d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\WPF_WinForms\TransparencyDialog.cs(99,12,99,21):
error CS0246:
The type or namespace name 'OCCTProxy' could not be found (are you missing a using directive or an assembly reference?)
2>d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\WPF_WinForms\TransparencyDialog.cs(19,13,19,22):
error CS0246:
The type or namespace name 'OCCTProxy' could not be found (are you missing a using directive or an assembly reference?)
2>d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\WPF_WinForms\MaterialDlg.xaml.cs(46,16,46,25):
error CS0246:
The type or namespace name 'OCCTProxy' could not be found (are you missing a using directive or an assembly reference?)
2>d:\Users\ddzama\activities\OCCTproducts\occt\install-vc143\samples\CSharp\WPF_WinForms\MaterialDlg.xaml.cs(32,23,32,32):
error CS0246:
The type or namespace name 'OCCTProxy' could not be found (are you missing a using directive or an assembly reference?)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

To solve the problem it is proposed to demand by default the highest version of NETFramework - 4.8.
So, demanding NETFramework v4.8 does not crashing compilation of csharp samples with VC++ 2015.
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot required

Relationships

parent of 0032921 closedddzama Configuration, CMake - allow selecting C++ standard 

Activities

git

2022-08-19 14:44

administrator   ~0110325

Branch CR32986 has been created by ddzama.

SHA-1: 65d725fa1ed88dc152d3d32c468b144271b3cca5


Detailed log of new commits:

Author: ddzama
Date: Fri Aug 19 14:41:49 2022 +0300

    0032986: Fix error of compilation WPF_D3D, WPF_WinForms and WinForms with MSVC 2022.

Author: ddzama
Date: Fri Aug 19 14:40:19 2022 +0300

    0032986: Fix error of compilation CSharp samples/OCCTProxy project with MSVC 2022.

git

2022-08-19 15:26

administrator   ~0110326

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 6bb4f4c918966c16f079b1a4401da4bdc2e28f8b

git

2022-08-22 10:32

administrator   ~0110335

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 844facf74b8cacbb87ffc2827939ec29fad22131

git

2022-08-29 12:51

administrator   ~0110400

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: ee48f5d8e7c30a29f349e69c55e7820e9fc31ac1

git

2022-08-29 13:44

administrator   ~0110408

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 8b536fff481a0afebc0d55aa28f3af88e550a2bb

git

2022-08-31 11:04

administrator   ~0110465

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: e8fc445cabccb7e427b73357bb25e947c9c2ba6b

msv

2022-08-31 11:28

developer   ~0110471

Please try to make fix without turning on conformance mode in the build settings.

git

2022-08-31 17:13

administrator   ~0110503

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 05ce23cb08d99a21085bd892078111946314ff42

ddzama

2022-09-02 12:28

developer   ~0110563

Last edited: 2022-09-02 12:31

@msv, see c++/CLI does not support officialy c++20 language standard. This issue began from attempt to compile the csharp/samples/OCCTProxy project using c++20 language standard.
So, the warning message from c1xx says: c1xx : warning C4857: C++/CLI mode does not support C++ versions newer than C++17; setting language to /std:c++17
I think this is the root of the problem.
If we pushing on employing c++20, we have to employ /permissive (ConformanceMode = false), rather then defined by default (/permissive-).
So, i think we should give up manual attempts to compile this project with c++20 language standard until official support of it by Microsoft Visual Studio.
Therefore, i will admit with you, and this arguable commit should be removed.

git

2022-09-02 12:38

administrator   ~0110564

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 27c02bf6b69d7672ea1de22568f1a0c1bf4d0b64

git

2022-09-03 00:32

administrator   ~0110584

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 699a56c16bc881c35e545514a2ae51aabf88d98e

git

2022-09-05 09:44

administrator   ~0110609

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: d3a7c7690729ca88bd209ea5eb25f4f8264cedd4

msv

2022-09-05 16:10

developer   ~0110666

Please make the commit title corresponding to the bug title.

Is there any problems with csharp samples in occt-products as well?

git

2022-09-06 01:20

administrator   ~0110691

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 3d446e0287f3291d97dcdb1502df976395c53233

ddzama

2022-09-06 01:22

developer   ~0110692

@msv - I update bug tracker issue title/description.
Git commit message has been updatet according to this issue title/description.

ddzama

2022-09-06 01:25

developer   ~0110693

@msv - i will try to compile it for occ pr.

ddzama

2022-09-06 11:09

developer   ~0110706

@msv - i did not meet any problems due to compiling occ pr csharp samples, even employing c++20 language standard for project for OCCwrapCSharp project.
But as i can see, it is pure c++ project, not c++/cli.

msv

2022-09-06 11:26

developer   ~0110710

@ddzama, there is no need to repeat in commit message the bug description. Commit message must describe in short the problem and solution. The current content of commit message is too detailed and large to my mind.

git

2022-09-06 12:13

administrator   ~0110718

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 399b30e474b98ea57217cc89251cd5b5568712be

git

2022-09-06 12:15

administrator   ~0110719

Branch CR32986 has been updated forcibly by ddzama.

SHA-1: 30247b55ee3a524d439b9847b0e331f7cc90108c

ddzama

2022-09-06 12:18

developer   ~0110720

@msv, ok, i see. I sufficiently reduce the git commit message. Retained only key information about compiler warnings/errors.

msv

2022-09-06 13:46

developer   ~0110731

For integration:
occt - CR32986
products - none

smoskvin

2022-09-11 13:56

administrator   ~0110919

Combination -
OCCT branch : IR-2022-09-09
master SHA - 526c506cb0a6a5c9c168ab5efd0a4e5211e30bf4
e0ceb716c70188b98130b1550914140d0502a6f9
Products branch : IR-2022-09-09 SHA - changes and them, and you can discard any commits you make in this
574253b6b844635a69038511e6920877f837e298
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18959.200000000466 / 18756.090000000648 [+1.08%]
Products
Total CPU difference: 12020.780000000137 / 11992.830000000133 [+0.23%]
Windows-64-VC14:
OCCT
Total CPU difference: 20894.5625 / 20851.65625 [+0.21%]
Products
Total CPU difference: 13470.484375 / 13574.0625 [-0.76%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-09-11 14:51

administrator   ~0110945

Branch CR32986 has been deleted by mnt.

SHA-1: 30247b55ee3a524d439b9847b0e331f7cc90108c

Related Changesets

occt: master d7eefb11

2022-08-19 14:41:49

ddzama


Committer: smoskvin Details Diff
0032986: Samples - csharp sample is crashed on compilation with VC++ 2022

While demanding c++ language standard c++20, the error of OCCTProxy compilation is occured:

warning C4857: C++/CLI mode does not support C++ versions newer than C++17; setting language to /std:c++17
error C7681: two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase-

Officially, C++/CLI mode does not support C++ version newer than C++17, so we should not demand C++20 to compile csharp samples.
Alternative solution - using /permissive (ConformanceMode = false), rather than default value /permissive- (ConformanceMode = true)
option to compile OCCTProxy. But alternative solution has been denied.
So, here is nothing to do to fix compilation of OCCTProxy project.

Nevertheless, error occures in IE_WPF_WinForms and IE_WinForms - if we trying to compile with VC++ 2022 (not demanding c++20):

warning MSB3274: The primary reference "*\OCCTProxy.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.7.2" framework.
This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

To solve the problem it is proposed to demand by default the highest version of NETFramework - 4.8.
So, demanding NETFramework v4.8 does not crashing compilation of csharp samples with VC++ 2015.
Affected Issues
0032986
mod - samples/CSharp/WinForms/app.config Diff File
mod - samples/CSharp/WinForms/IE_WinForms.csproj Diff File
mod - samples/CSharp/WPF_D3D/app.config Diff File
mod - samples/CSharp/WPF_D3D/IE_WPF_D3D.csproj Diff File
mod - samples/CSharp/WPF_WinForms/app.config Diff File
mod - samples/CSharp/WPF_WinForms/IE_WPF_WinForms.csproj Diff File

Issue History

Date Modified Username Field Change
2022-05-19 19:58 afokin New Issue
2022-05-19 19:58 afokin Assigned To => ddzama
2022-05-19 20:44 kgv Product Version => 7.7.0
2022-05-19 20:44 kgv Target Version 7.6.3 => 7.7.0
2022-05-19 20:44 kgv Summary Samples: csharp sample is crashed on compilation with C++20 => Samples - csharp sample is crashed on compilation with C++20
2022-05-19 20:45 kgv Relationship added child of 0032887
2022-05-19 20:45 kgv Description Updated
2022-08-19 14:44 git Note Added: 0110325
2022-08-19 15:26 git Note Added: 0110326
2022-08-22 10:32 git Note Added: 0110335
2022-08-29 12:51 git Note Added: 0110400
2022-08-29 13:44 git Note Added: 0110408
2022-08-31 10:30 ddzama Relationship added child of 0032921
2022-08-31 10:30 ddzama Relationship deleted child of 0032887
2022-08-31 10:31 ddzama Assigned To ddzama => msv
2022-08-31 10:31 ddzama Status new => resolved
2022-08-31 10:31 ddzama Steps to Reproduce Updated
2022-08-31 10:43 ddzama Relationship deleted child of 0032921
2022-08-31 10:44 ddzama Relationship added parent of 0032921
2022-08-31 11:04 git Note Added: 0110465
2022-08-31 11:28 msv Note Added: 0110471
2022-08-31 11:28 msv Assigned To msv => ddzama
2022-08-31 11:28 msv Status resolved => assigned
2022-08-31 17:13 git Note Added: 0110503
2022-09-02 12:28 ddzama Note Added: 0110563
2022-09-02 12:31 ddzama Note Edited: 0110563
2022-09-02 12:38 git Note Added: 0110564
2022-09-02 17:38 ddzama Assigned To ddzama => msv
2022-09-02 17:38 ddzama Status assigned => resolved
2022-09-03 00:32 git Note Added: 0110584
2022-09-05 09:44 git Note Added: 0110609
2022-09-05 16:10 msv Note Added: 0110666
2022-09-05 16:10 msv Assigned To msv => ddzama
2022-09-05 16:10 msv Status resolved => assigned
2022-09-06 01:04 ddzama Summary Samples - csharp sample is crashed on compilation with C++20 => Samples - csharp sample is crashed on compilation with VC++ 2022
2022-09-06 01:04 ddzama Description Updated
2022-09-06 01:06 ddzama Description Updated
2022-09-06 01:12 ddzama Description Updated
2022-09-06 01:14 ddzama Description Updated
2022-09-06 01:14 ddzama Description Updated
2022-09-06 01:20 ddzama Description Updated
2022-09-06 01:20 git Note Added: 0110691
2022-09-06 01:22 ddzama Note Added: 0110692
2022-09-06 01:25 ddzama Note Added: 0110693
2022-09-06 11:09 ddzama Note Added: 0110706
2022-09-06 11:26 msv Note Added: 0110710
2022-09-06 12:13 git Note Added: 0110718
2022-09-06 12:15 git Note Added: 0110719
2022-09-06 12:18 ddzama Note Added: 0110720
2022-09-06 13:46 msv Assigned To ddzama => msv
2022-09-06 13:46 msv Status assigned => resolved
2022-09-06 13:46 msv Assigned To msv => bugmaster
2022-09-06 13:46 msv Status resolved => reviewed
2022-09-06 13:46 msv Note Added: 0110731
2022-09-11 13:56 smoskvin Status reviewed => tested
2022-09-11 13:56 smoskvin Note Added: 0110919
2022-09-11 14:03 smoskvin Test case number => Not required
2022-09-11 14:40 smoskvin Changeset attached => occt master d7eefb11
2022-09-11 14:40 ddzama Assigned To bugmaster => ddzama
2022-09-11 14:40 ddzama Status tested => verified
2022-09-11 14:40 ddzama Resolution open => fixed
2022-09-11 14:51 git Note Added: 0110945
2023-03-19 20:18 vglukhik Status verified => closed
2023-03-19 20:18 vglukhik Fixed in Version => 7.7.0