CERES_GFLAGS_NAMESPACE ERROR

449 views
Skip to first unread message

Asad Abbas

unread,
Nov 8, 2016, 1:10:20 PM11/8/16
to Ceres Solver
When I try to run bundle_adjuster it gives me this error can you help me resolve it

F:\ceres-solver-1.11.0\examples\bundle_adjuster.cc(348): error C2653: 'CERES_GFLAGS_NAMESPACE' : is not a class or namespace name
F:\ceres-solver-1.11.0\examples\bundle_adjuster.cc(348): error C3861: 'ParseCommandLineFlags': identifier not found

Alex Stewart

unread,
Nov 8, 2016, 1:17:19 PM11/8/16
to ceres-...@googlegroups.com
How did you generate the MSVC project for Ceres?  Did you use CMake to generate the project?

CERES_GFLAGS_NAMESPACE is passed via a compile flag definition based on the result of FindGflags.cmake, which detects the correct namespace for the installed version of gflags (it has been both gflags and google in different versions).  This should be set automatically by CMake when building Ceres and its examples.

-Alex

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/023db680-3bda-42b9-97f9-59543e7cf1ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Asad Abbas

unread,
Nov 8, 2016, 1:26:19 PM11/8/16
to ceres-...@googlegroups.com
Yes I used cmake to generate the project can you please tell me possible steps to fix this issue.

On Tue, Nov 8, 2016 at 11:17 PM, Alex Stewart <alex...@gmail.com> wrote:
How did you generate the MSVC project for Ceres?  Did you use CMake to generate the project?

CERES_GFLAGS_NAMESPACE is passed via a compile flag definition based on the result of FindGflags.cmake, which detects the correct namespace for the installed version of gflags (it has been both gflags and google in different versions).  This should be set automatically by CMake when building Ceres and its examples.

-Alex

On Nov 8, 2016, at 6:10 PM, Asad Abbas <abbasa...@gmail.com> wrote:

When I try to run bundle_adjuster it gives me this error can you help me resolve it

F:\ceres-solver-1.11.0\examples\bundle_adjuster.cc(348): error C2653: 'CERES_GFLAGS_NAMESPACE' : is not a class or namespace name
F:\ceres-solver-1.11.0\examples\bundle_adjuster.cc(348): error C3861: 'ParseCommandLineFlags': identifier not found

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/XRAv1v_9Kmo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/680DED32-BBF3-4BC9-A085-ED140855A267%40gmail.com.

Asad Abbas

unread,
Nov 8, 2016, 1:31:45 PM11/8/16
to Ceres Solver
Yes I used cmake to generate the project can you please tell me possible steps to fix this issue.

Alex Stewart

unread,
Nov 8, 2016, 2:16:19 PM11/8/16
to ceres-...@googlegroups.com
What is the value of GFLAGS_NAMESPACE in the CMake GUI?

You should see a line like this:

-- Found Google Flags header in: /usr/local/include, in namespace: google

in the CMake status output, do you?

As it appears that you have already built Ceres itself, assuming you built it with gflags enabled, it must have successfully compiled the tests, which rely on the same add_definitions() pattern, so I don’t know why CMake would have failed to generate the projects for the examples incorrectly.  You should be able to fix it locally by adding a definition rule for CERES_GFLAGS_NAMESPACE via /DCERES_GFLAGS_NAMESPACE=<INSERT_GFLAGS_NAMESPACE_HERE> using google or gflags, whichever it is for your install - the CMake status output from FindGflags should say which one.

-Alex

Asad Abbas

unread,
Nov 9, 2016, 8:28:57 AM11/9/16
to Ceres Solver
I have tried compiling it from scratch and got this error. Used visual studio 11 2012 as generator, everything went fine golg and gflags were also fine,even compilation of ceres was also fine but when I try to compile bundle_adjuster I get this error. I am beginner in using ceres solver or cmake so please let me know what went wrong this time.

ceres-debug.lib(minimizer.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) int fLI::FLAGS_v" (__imp_?FLAGS_v@fLI@@3HA)
5>F:\Ceres\ceres-solver-1.12.0rc1\Build\bin\Debug\bundle_adjuster.exe : fatal error LNK1120: 16 unresolved externals
Reply all
Reply to author
Forward
0 new messages