Hi
I run cmake to configure the build:
cmake -S . -B build -DBUILD_DEPS=ON -DBUILD_DOTNET=ON -DUSE_DOTNET_6=ON -DUSE_DOTNET_8=OFF -G "Visual Studio 17 2022"
The first few lines from the log are:
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26200.
-- The CXX compiler identification is MSVC 19.44.35220.0
-- The C compiler identification is MSVC 19.44.35220.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- ortools version: 9.14.6217
-- Configuration types: Debug;Release;MinSizeRel;RelWithDebInfo
-- Build C++ library: ON
-- Build Python: OFF
-- Build Java: OFF
-- Build .Net: ON
-- Build Flatzinc: ON
-- Build MathOpt: ON
-- Build samples: ON
-- Build C++ samples: ON
-- Build Python samples: OFF
-- Build Java samples: OFF
-- Build .Net samples: ON
-- Build examples: ON
-- Build C++ examples: ON
-- Build Python examples: OFF
-- Build Java examples: OFF
-- Build .Net examples: ON
-- Build documentation: OFF
-- Install doc: OFF
-- Build all dependencies: ON
-- Build ZLIB: ON
-- Build BZip2: ON
-- Build abseil-cpp: ON
-- Build protobuf: ON
-- Build eigen3: ON
-- Build re2: ON
-- Build googletest: ON
-- Build benchmark: ON
-- Enable fuzztest: OFF
-- Build fuzztest: OFF
-- BOP support: ON
-- COIN-OR support: ON
-- Build CoinUtils: ON
-- Build Osi: ON
-- Build Clp: ON
-- Build Cgl: ON
-- Build Cbc: ON
-- GLOP support: ON
-- GLPK support: OFF
-- Build GLPK: OFF
-- Gurobi support: ON
-- HiGHS support: ON
-- Build HiGHS: ON
-- PDLP support: ON
-- Build PDLP: ON
-- SCIP support: ON
-- Build Boost (Soplex requirement): ON
-- Build Soplex (SCIP requirement): ON
-- Build SCIP: ON
-- CPLEX support: OFF
-- Xpress support: ON
-- C++: Build doc: OFF
-- .Net: Create multiple OS Package: OFF
-- .Net: Build doc: OFF
-- .Net C# language version: 9.0
-- .Net Samples C# language version: 8.0
-- .Net: Use .Net Framework 4.6 support: OFF
-- .Net: Use .Net Framework 4.6.1 support: OFF
-- .Net: Use .Net Framework 4.6.2 support: OFF
-- .Net: Use .Net Framework 4.8 support: OFF
-- .Net: Use .Net Framework 2.1 support: OFF
-- .Net: Use .Net Core 3.1 LTS support: OFF
-- .Net: Use .Net 6.0 LTS support: ON
-- .Net: Use .Net 7.0 support: OFF
-- .Net: Use .Net 8.0 support: OFF
-- .Net: Use .Net 9.0 support: OFF
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Fetching SWIG
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26200.
-- Configuring done (0.7s)
-- Generating done (0.1s)
-- Build files have been written to: G:/or-tools-9.14/or-tools/build/dependencies/SWIG/project_build
MSBuild version 17.14.23+b0019275e for .NET Framework
1>Checking Build System
Creating directories for 'SWIG_project'
Then I build the source code:
cmake --build build --config Release -j -v
I then get a fatal error in linking
Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See
https://aka.ms/cpp/structured-output for more details.
Creating directory "ortools.dir\Release\ortools.tlog\".
InitializeBuildStatus:
Creating "ortools.dir\Release\ortools.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
Touching "ortools.dir\Release\ortools.tlog\unsuccessfulbuild".
CustomBuild:
Building Custom Rule G:/or-tools-9.14/or-tools/CMakeLists.txt
PreLinkEvent:
Auto build dll exports
setlocal
cd G:\or-tools-9.14\or-tools\build
if %errorlevel% neq 0 goto :cmEnd
G:
if %errorlevel% neq 0 goto :cmEnd
"C:\Program Files\CMake\bin\cmake.exe" -E __create_def G:/or-tools-9.14/or-tools/build/ortools.dir/Release/exports.def G:/or-tools-9.14/or-tools/build/ortools.dir/Release//objects.txt
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd
Link:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\link.exe /OUT:"G:\or-tools-9.14\or-tools\build\Release\bin\ortools.dll" /VERSION:"9.14" /INCREMENTAL:NO /NOLOGO Release\bin\bz2.lib Release\bin\absl_flags_commandlineflag.lib Release\bin\absl_flags_marshalling.lib Release\bin\absl_flags_parse.lib Release\bin\absl_flags_reflection.lib Release\bin\absl_flags_usage.lib Release\bin\absl_log_flags.lib Release\bin\libprotobuf.lib Release\bin\re2.lib Release\bin\CbcSolver.lib Release\bin\OsiCbc.lib Release\bin\ClpSolver.lib Release\bin\OsiClp.lib Release\bin\highs.lib Release\bin\libscip.lib psapi.lib ws2_32.lib Release\bin\absl_flags_usage_internal.lib Release\bin\absl_flags_reflection.lib Release\bin\absl_flags_private_handle_accessor.lib Release\bin\absl_flags_internal.lib Release\bin\absl_flags_commandlineflag.lib Release\bin\absl_flags_marshalling.lib Release\bin\absl_flags_config.lib Release\bin\absl_flags_program_name.lib Release\bin\absl_flags_commandlineflag_internal.lib Release\bin\abseil_dll.lib "-ignore:4221" Release\bin\Cbc.lib Release\bin\Cgl.lib Release\bin\OsiClp.lib Release\bin\Clp.lib Release\bin\Osi.lib Release\bin\CoinUtils.lib Release\bin\zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /DEF:"G:/or-tools-9.14/or-tools/build/ortools.dir/Release/exports.def" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"G:/or-tools-9.14/or-tools/build/Release/bin/ortools.pdb" /TLBID:1 /IMPLIB:"G:/or-tools-9.14/or-tools/build/Release/bin/ortools.lib" /MACHINE:X64 /machine:x64 /DLL "G:\or-tools-9.14\or-tools\build\ortools_proto.dir\Release\bop_parameters.pb.obj"
"G:\or-tools-9.14\or-tools\build\ortools_proto.dir\Release\assignment.pb.obj"
"G:\or-tools-9.14\or-tools\build\ortools_proto.dir\Release\demon_profiler.pb.obj"
...
"G:\or-tools-9.14\or-tools\build\ortools\math_opt\constraints\sos\ortools_math_opt_constraints_sos.dir\Release\validator.obj"
"G:\or-tools-9.14\or-tools\build\ortools\math_opt\constraints\util\ortools_math_opt_constraints_util.dir\Release\model_util.obj"
279>LINK : fatal error LNK1189: library limit of 65535 objects exceeded [G:\or-tools-9.14\or-tools\build\ortools.vcxproj]
279>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools.vcxproj" (default targets) -- FAILED.
190>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools\linear_solver\csharp\dotnet_model_builder.vcxproj" (default targets) -- FAILED.
13>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools\algorithms\csharp\dotnet_algorithms.vcxproj" (default targets) -- FAILED.
33>Done Building Project "G:\or-tools-9.14\or-tools\build\Dotnetortools_proto.vcxproj" (default targets) -- FAILED.
160>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools\graph\csharp\dotnet_graph.vcxproj" (default targets) -- FAILED.
14>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools\constraint_solver\csharp\dotnet_constraint_solver.vcxproj" (default targets) -- FAILED.
194>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools\linear_solver\csharp\dotnet_linear_solver.vcxproj" (default targets) -- FAILED.
20>Done Building Project "G:\or-tools-9.14\or-tools\build\dotnet_package.vcxproj" (default targets) -- FAILED.
11>Done Building Project "G:\or-tools-9.14\or-tools\build\ortools\algorithms\csharp\dotnet_algorithms_KnapsackSolverTests.vcxproj" (default targets) -- FAILED.
1>Done Building Project "G:\or-tools-9.14\or-tools\build\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Build FAILED.
Just wondering what I am missing and how to solve this issue, please.
Regards
John