[Fixed][Sketcher] windows build fails (conda)

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

[Fixed][Sketcher] windows build fails (conda)

Post by looo »

Building for windows with conda currently fails with the following error:

Code: Select all

GeoList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoEnum.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoEnum.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoEnum.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
   Creating library src\Mod\Sketcher\App\Sketcher.lib and object src\Mod\Sketcher\App\Sketcher.exp
Maybe abdullah can help with this issue:
abdullah wrote:
Last edited by looo on Sun Jan 16, 2022 3:16 pm, edited 1 time in total.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: [Sketcher] windows build fails (conda)

Post by looo »

wmayer wrote:
can you help with this isssue, it's still failing after 2 weeks.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Sketcher] windows build fails (conda)

Post by wmayer »

Is this built from current master? What compiler does Windows Conda actually use?

So far we have current master working on:
  • Linux with clang/gcc
  • macOS with clang
  • Windows with MSVC
  • Windows with MSYS/clang
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: [Sketcher] windows build fails (conda)

Post by looo »

wmayer wrote: Sun Jan 16, 2022 5:05 pm Is this built from current master? What compiler does Windows Conda actually use?

So far we have current master working on:
  • Linux with clang/gcc
  • macOS with clang
  • Windows with MSVC
  • Windows with MSYS/clang
Conda uses msvc for windows to build freecad.

Code: Select all

-- The C compiler identification is MSVC 19.16.27045.0
-- The CXX compiler identification is MSVC 19.16.27045.0

Code: Select all

SketchAnalysis.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
SketchAnalysis.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
SketchAnalysis.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
AppSketcher.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
ExternalGeometryFacadePyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
ExternalGeometryFacadePyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
ExternalGeometryFacadePyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
ConstraintPyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
ConstraintPyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
ConstraintPyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
SketchPyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
SketchPyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
SketchPyImp.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
PropertyConstraintList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
PropertyConstraintList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
PropertyConstraintList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Constraint.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Constraint.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Constraint.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Sketch.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Sketch.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Sketch.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoList.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoEnum.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::RtPnt" (?RtPnt@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoEnum.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::HAxis" (?HAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
GeoEnum.cpp.obj : error LNK2005: "public: static class Sketcher::GeoElementId const Sketcher::GeoElementId::VAxis" (?VAxis@GeoElementId@Sketcher@@2V12@B) already defined in SketchObject.cpp.obj
Maybe it's related to using -D FREECAD_USE_PCH:BOOL=OFF for these builds.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Sketcher] windows build fails (conda)

Post by wmayer »

Maybe it's related to using -D FREECAD_USE_PCH:BOOL=OFF for these builds.
Very unlikely. It's probably related to the MSVC compiler version.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: [Sketcher] windows build fails (conda)

Post by GeneFC »

looo wrote: Mon Jan 17, 2022 10:54 am Conda uses msvc for windows to build freecad.

Code: Select all

-- The C compiler identification is MSVC 19.16.27045.0
-- The CXX compiler identification is MSVC 19.16.27045.0
I have used those exact versions of the compilers multiple times without problems.

I just used 19.29.30139, again with no problems.

Using LibPack, not Conda.

Gene
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: [Sketcher] windows build fails (conda)

Post by chennes »

looo wrote: Mon Jan 17, 2022 10:54 am Conda uses msvc for windows to build freecad.
Is a Conda build "clean"? I had an issue last week that required me to do a from-scratch rebuild on Visual Studio -- I don't recall the exact error, but it was related to something in Sketcher.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: [Sketcher] windows build fails (conda)

Post by looo »

chennes wrote: Sun Jan 23, 2022 5:55 pm
looo wrote: Mon Jan 17, 2022 10:54 am Conda uses msvc for windows to build freecad.
Is a Conda build "clean"? I had an issue last week that required me to do a from-scratch rebuild on Visual Studio -- I don't recall the exact error, but it was related to something in Sketcher.
conda does a full rebuild, no caching.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: [Sketcher] windows build fails (conda)

Post by looo »

GeneFC wrote: Tue Jan 18, 2022 7:58 pm I have used those exact versions of the compilers multiple times without problems.

I just used 19.29.30139, again with no problems.
wmayer wrote: Sun Jan 16, 2022 5:05 pm Is this built from current master?
the issue occurs only with current master, not with 0.19.3.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Sketcher] windows build fails (conda)

Post by wmayer »

the issue occurs only with current master, not with 0.19.3
Of course. It's all about this class https://github.com/FreeCAD/FreeCAD/blob ... /GeoEnum.h that has been added last month.

I would have assumed that it's a compiler bug because it's working with so many compilers and it's perfectly valid C++ code. But now that Gene said he uses the exact same compiler version and for him it works then I guess something must be wrong with the object files from a previous build.
conda does a full rebuild, no caching.
Not using a cache is not the same as doing a clean rebuild. So, let me rephrase the question: are you sure that between two builds all object files (*.obj) are deleted?
Post Reply