View Issue Details

IDProjectCategoryView StatusLast Update
0033153Open CASCADEOCCT:Configurationpublic2022-11-02 13:53
Reporterszy Assigned Toddzama  
PriorityhighSeverityblock 
Status verifiedResolutionfixed 
PlatformWindowsOSVC++ 2022 
Product Version7.7.0 
Target Version7.7.0 
Summary0033153: Configuration: Linker error when building from source for VS2022 x64
DescriptionCustomer's complaint when testing 7.7.0-beta.

I get a linker error when building from source for VS2022 x64:
2>XCAFDoc_Editor.obj : error LNK2019: riferimento al simbolo esterno "public: class opencascade::handle<class XCAFNoteObjects_NoteObject> __cdecl XCAFDoc_Note::GetObject(void)const " (?GetObject@XCAFDoc_Note@@QEBA?AV?$handle@VXCAFNoteObjects_NoteObject@@@opencascade@@XZ) non risolto nella funzione "public: static bool __cdecl XCAFDoc_Editor::RescaleGeometry(class TDF_Label const &,double,bool)" (?RescaleGeometry@XCAFDoc_Editor@@SA_NAEBVTDF_Label@@N_N@Z)

I have investigated a bit. It doesn't depend on third parties, but on BUILD_WITH_PCH=ON .
Use standard generator, Visual studio 2022, x64, any configuration,
-DBUILD_WITH_FREETYPE=OFF -DBUILD_WITH_PCH=ON -DBUILD_Module_Draw=OFF

A similar problem is also observed in the TKService and TKOpenGles modules

without PCH it works good!

The problem is reproduced.

Proposed solution: turn off cotire from targets, whose compilation cause error while applying cotire tool:
TKService
TKOpenGl
TKOpenGles
TKXCAF
TKXDEDRAW
TKDFBrowser
TKMessageModel
TKMessageView
TKShapeView
TKTInspector
TKTreeModel
TKVInspector
TKView
Steps To ReproduceNot required
TagsNo tags attached.
Test case number

Relationships

related to 0033162 newddzama Open CASCADE Configuration: Enabling BUILD_WITH_PCH flag causes compilation warnings 

Activities

git

2022-10-07 09:56

administrator   ~0111424

Branch CR33153 has been created by ddzama.

SHA-1: 42a1ebe614ab1df3188ca922b02d93050bd6d963


Detailed log of new commits:

Author: ddzama
Date: Fri Oct 7 09:46:27 2022 +0300

    f

Author: ddzama
Date: Thu Oct 6 14:05:08 2022 +0300

    0033153: Migrate to cotire 1.8.1 (from 1.7.9).

Author: ddzama
Date: Thu Oct 6 13:29:08 2022 +0300

    0033153: Configuration: Linker error when building from source for VS2022 x64.
    
    Linking error occures if applying cotire tool:
    
    ``

git

2022-10-07 10:02

administrator   ~0111425

Branch CR33153 has been updated forcibly by ddzama.

SHA-1: 54eddb066cc40f88f17db6f1e638113694348d0d

git

2022-10-07 11:25

administrator   ~0111428

Branch CR33153 has been updated forcibly by ddzama.

SHA-1: 13cebce3d99d889a858c9e03844124659cb66df4

git

2022-10-07 13:54

administrator   ~0111434

Branch CR33153 has been updated forcibly by ddzama.

SHA-1: 264307ab015f8e91c5b32856ce4763d3931f3d16

ddzama

2022-10-07 13:57

developer   ~0111435

@msv - integration only for OCCT.

msv

2022-10-07 14:47

developer   ~0111437

To integrate:
occt - CR33153
products - none

git

2022-10-10 00:26

administrator   ~0111445

Branch CR33153 has been updated forcibly by ddzama.

SHA-1: db5220ce5b2f59287d462698a7218e6905c3e998

git

2022-11-02 13:53

administrator   ~0111876

Branch CR33153 has been deleted by mnt.

SHA-1: db5220ce5b2f59287d462698a7218e6905c3e998

Related Changesets

occt: master 3536158f

2022-10-06 13:29:08

ddzama


Committer: smoskvin Details Diff
0033153: Configuration: Linker error when building from source for VS2022 x64.

With enabled flag BUILD_USE_PCH we get an error of compilation of TKService:

1>Image_VideoRecorder.obj :
error LNK2019:
unresolved external symbol
"int __cdecl av_strerror(int,char *,unsigned __int64)"
(?av_strerror@@YAHHPEAD_K@Z) referenced in function
"protected: class TCollection_AsciiString __cdecl Image_VideoRecorder::formatAvError(int)const "
(?formatAvError@Image_VideoRecorder@@IEBA?AVTCollection_AsciiString@@H@Z)
1>Media_FormatContext.obj :
error LNK2001:
unresolved external symbol
"int __cdecl av_strerror(int,char *,unsigned __int64)" (?av_strerror@@YAHHPEAD_K@Z)

And many other similar errors. Similar errors occures in some other projects too:

TKService
TKOpenGl
TKOpenGles
TKXCAF
TKXDEDRAW
TKDFBrowser
TKMessageModel
TKMessageView
TKShapeView
TKTInspector
TKTreeModel
TKVInspector
TKView

Proposed solution: turn off cotire from targets, whose compilation cause error while applying cotire tool.
In this ticket migration to cotire 1.8.1 (from 1.7.9) is done.

COTIRE_PREFIX_HEADER_IGNORE_PATH does not apply here, because its employing
causes some errors in 3rdparty libraries (for example, in TKService project).

Projects (TKDFBrowser TKMessageModel TKMessageView TKShapeView TKTInspector TKTreeModel TKVInspector TKView)
which use Qt may be proceeded by cotire tool, but after fixing a bug of cotire:

https://gitlab.kitware.com/cmake/cmake/-/issues/18353

0033153: Fix cotire bug, causing impossibility of compilation targets depending from Qt.

Solution is proposed in:
https://gitlab.kitware.com/cmake/cmake/-/issues/18353
Affected Issues
0033153
mod - adm/cmake/cotire.cmake Diff File
mod - adm/cmake/occt_toolkit.cmake Diff File
mod - src/TKOpenGl/CMakeLists.txt Diff File
mod - src/TKOpenGles/CMakeLists.txt Diff File
mod - src/TKService/CMakeLists.txt Diff File
mod - src/TKXCAF/CMakeLists.txt Diff File
mod - src/TKXDEDRAW/CMakeLists.txt Diff File
mod - tools/TKDFBrowser/CMakeLists.txt Diff File
mod - tools/TKMessageModel/CMakeLists.txt Diff File
mod - tools/TKMessageView/CMakeLists.txt Diff File
mod - tools/TKShapeView/CMakeLists.txt Diff File
mod - tools/TKTInspector/CMakeLists.txt Diff File
mod - tools/TKTreeModel/CMakeLists.txt Diff File
mod - tools/TKView/CMakeLists.txt Diff File
mod - tools/TKVInspector/CMakeLists.txt Diff File

Issue History

Date Modified Username Field Change
2022-10-03 18:10 szy New Issue
2022-10-03 18:10 szy Assigned To => smoskvin
2022-10-03 18:11 szy Status new => assigned
2022-10-04 15:29 smoskvin Description Updated
2022-10-04 15:31 smoskvin Description Updated
2022-10-04 15:32 smoskvin Assigned To smoskvin => ddzama
2022-10-04 15:41 szy Priority normal => high
2022-10-07 09:56 git Note Added: 0111424
2022-10-07 10:02 git Note Added: 0111425
2022-10-07 10:06 ddzama Description Updated
2022-10-07 11:25 git Note Added: 0111428
2022-10-07 13:54 git Note Added: 0111434
2022-10-07 13:56 ddzama Assigned To ddzama => msv
2022-10-07 13:56 ddzama Status assigned => resolved
2022-10-07 13:56 ddzama Steps to Reproduce Updated
2022-10-07 13:57 ddzama Note Added: 0111435
2022-10-07 14:47 msv Assigned To msv => bugmaster
2022-10-07 14:47 msv Status resolved => reviewed
2022-10-07 14:47 msv Note Added: 0111437
2022-10-10 00:26 git Note Added: 0111445
2022-10-10 10:23 ddzama Relationship added related to 0033162
2022-11-02 13:40 smoskvin Status reviewed => tested
2022-11-02 13:46 smoskvin Changeset attached => occt master 3536158f
2022-11-02 13:46 ddzama Assigned To bugmaster => ddzama
2022-11-02 13:46 ddzama Status tested => verified
2022-11-02 13:46 ddzama Resolution open => fixed
2022-11-02 13:53 git Note Added: 0111876