From ccfd7f4dbb2e06aab27f15337eabbae7aa8d5540 Mon Sep 17 00:00:00 2001 From: Je Hyeong Hong Date: Thu, 2 Feb 2017 04:36:41 +0900 Subject: [PATCH] CERES_EXPORT fix to compile Ceres as DLL Below fixes are required to compile Ceres as a dynamic library using MSVC. 1. Added CERES_EXPORT to EigenQuaternionParameterization. 2. Removed CERES_EXPORT from CubicInterpolator and BicubicInterpolator. EigenQuaternionParameterization has its source embedded in ceres.dll whereas Cubic+BicubicInterpolators are defined in the header file and therefore do not require __declspec(dllimport). Change-Id: Idd1f387890c36aab51a1a4177ea7c06933b96f39 --- include/ceres/cubic_interpolation.h | 4 ++-- include/ceres/local_parameterization.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ceres/cubic_interpolation.h b/include/ceres/cubic_interpolation.h index 53bbc3373..9804a332d 100644 --- a/include/ceres/cubic_interpolation.h +++ b/include/ceres/cubic_interpolation.h @@ -121,7 +121,7 @@ void CubicHermiteSpline(const Eigen::Matrix& p0, // double f, dfdx; // interpolator.Evaluator(1.5, &f, &dfdx); template -class CERES_EXPORT CubicInterpolator { +class CubicInterpolator { public: explicit CubicInterpolator(const Grid& grid) : grid_(grid) { @@ -253,7 +253,7 @@ struct Grid1D { // interpolator.Evaluate(1.2, 2.5, &f, &dfdr, &dfdc); template -class CERES_EXPORT BiCubicInterpolator { +class BiCubicInterpolator { public: explicit BiCubicInterpolator(const Grid& grid) : grid_(grid) { diff --git a/include/ceres/local_parameterization.h b/include/ceres/local_parameterization.h index 379fc6849..046c6bdf4 100644 --- a/include/ceres/local_parameterization.h +++ b/include/ceres/local_parameterization.h @@ -222,7 +222,7 @@ class CERES_EXPORT QuaternionParameterization : public LocalParameterization { // // Plus(x, delta) = [sin(|delta|) delta / |delta|, cos(|delta|)] * x // with * being the quaternion multiplication operator. -class EigenQuaternionParameterization : public ceres::LocalParameterization { +class CERES_EXPORT EigenQuaternionParameterization : public ceres::LocalParameterization { public: virtual ~EigenQuaternionParameterization() {} virtual bool Plus(const double* x,