Я сейчас пытаюсь построить этот пример программы CP Solver < /p>
Компилятор работает нормально, но линкер дает мне «неразрешенный внешний символ» на этих 3: < /p>
- />
- absl :: lts_20240722 :: parsecommandline (int, char * * const) < /li>
absl :: lts_20240722 :: setprogramusagemessage (class std :: basic_string_view ) absl :: lts_20240722 :: container_internal :: ctrl_t const * const absl :: lts_20240722 :: container_internal :: kemptygroup
Вот код, который я компилируюсь. < /p>
#include
#include "absl/base/log_severity.h"
#include "absl/log/globals.h"
#include "ortools/base/init_google.h"
#include "ortools/base/logging.h"
#include "ortools/sat/cp_model.h"
#include "ortools/sat/cp_model.pb.h"
#include "ortools/sat/cp_model_solver.h"
#include "ortools/sat/model.h"
#include "ortools/sat/sat_parameters.pb.h"
#include "ortools/util/sorted_interval_list.h"
#include "ortools/constraint_solver/routing_search.h"
namespace operations_research {
namespace sat {
void SearchAllSolutionsSampleSat() {
CpModelBuilder cp_model;
const Domain domain(0, 2);
const IntVar x = cp_model.NewIntVar(domain).WithName("x");
const IntVar y = cp_model.NewIntVar(domain).WithName("y");
const IntVar z = cp_model.NewIntVar(domain).WithName("z");
cp_model.AddNotEqual(x, y);
Model model;
int num_solutions = 0;
model.Add(NewFeasibleSolutionObserver([&](const CpSolverResponse& r) {
LOG(INFO)
Подробнее здесь: https://stackoverflow.com/questions/797 ... ons-abseil
Мобильная версия