f3d icon indicating copy to clipboard operation
f3d copied to clipboard

`BUILD_SHARED_LIBS=OFF` with OCCT plugin on Windows fails to build because of name conflict

Open mwestphal opened this issue 1 year ago • 0 comments

Describe the bug BUILD_SHARED_LIBS=OFF with OCCT plugin on Windows fails to build because of name conflict

Indeed, with OCCT plugin and static build, there are exported symbols for some reason, which causes MSVC to created a f3d.lib file for the f3d.exe. This is an automatic mechanism that cannot be disabled in MSVC.

This file conflicts with the actual f3d.lib from the libf3d, causing a build issue.

To Reproduce Steps to reproduce the behavior:

  1. Build F3D on Windows with -DBUILD_SHARED_LIBS=OFF -DF3D_PLUGIN_BUILD_OCCT=ON
  2. Build fails with:
   VTKExtensionsPluginOCCT.vcxproj -> D:\a\f3d\f3d\build\bin_Release\VTKExtensionsPluginOCCT.exe
  Generating F3DIcon.h, F3DIcon.cxx
  Building Custom Rule D:/a/f3d/f3d/source/application/CMakeLists.txt
  F3DConfigFileTools.cxx
  F3DIcon.cxx
  F3DOptionsParser.cxx
  F3DStarter.cxx
  F3DSystemTools.cxx
  main.cxx
  Generating Code...
LINK : fatal error LNK1149: output filename matches input filename 'D:\a\f3d\f3d\build\lib_Release\f3d.lib' [D:\a\f3d\f3d\build\application\f3d.vcxproj]

Expected behavior Build complete

System Information:

  • OS: Windows
  • GPU and GPU driver: /

F3D Information Paste the content of f3d --version: master

Additional context Please note ENABLE_EXPORTS has no effect here, confirmed by Brad King

mwestphal avatar Mar 22 '24 07:03 mwestphal