Skip to content

Build & make errors #2

Description

@Oshino-Ougi

Hi~
I want to try your demo, but after I tried to build it, some errors occurred:

After I use make -j4, it occurred:

Scanning dependencies of target FeatureTracker
[ 12%] Building CXX object CMakeFiles/FeatureTracker.dir/src/ORBFeatureMatcher.cc.o
[ 25%] Building CXX object CMakeFiles/FeatureTracker.dir/src/SuperPointFeatureTracker.cc.o
[ 50%] Building CXX object CMakeFiles/FeatureTracker.dir/src/ORBFeatureDetector.cc.o
[ 50%] Building CXX object CMakeFiles/FeatureTracker.dir/src/main_track.cc.o
[ 62%] Building CXX object CMakeFiles/FeatureTracker.dir/src/SuperPointFeatureDetector.cc.o
[ 75%] Building CXX object CMakeFiles/FeatureTracker.dir/src/ORBFeatureTracker.cc.o
[ 87%] Building CXX object CMakeFiles/FeatureTracker.dir/src/SuperPointFeatureMatcher.cc.o
[100%] Linking CXX executable FeatureTracker
CMakeFiles/FeatureTracker.dir/src/main_track.cc.o:In function ‘_GLOBAL__sub_I_main_track.cc’:
main_track.cc:(.text.startup+0x1194):undefined reference to ‘google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)’
main_track.cc:(.text.startup+0x121e):undefined reference to ‘google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)’
main_track.cc:(.text.startup+0x12d6):undefined reference to ‘google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)’
CMakeFiles/FeatureTracker.dir/src/ORBFeatureDetector.cc.o:In function ‘std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)’:
ORBFeatureDetector.cc:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x50):undefined reference to ‘google::base::CheckOpMessageBuilder::NewString()’
CMakeFiles/FeatureTracker.dir/src/ORBFeatureDetector.cc.o:In function ‘std::string* google::MakeCheckOpString<float, int>(float const&, int const&, char const*)’:
ORBFeatureDetector.cc:(.text._ZN6google17MakeCheckOpStringIfiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIfiEEPSsRKT_RKT0_PKc]+0x56):undefined reference to ‘google::base::CheckOpMessageBuilder::NewString()’
CMakeFiles/FeatureTracker.dir/src/ORBFeatureMatcher.cc.o:In function ‘std::string* google::MakeCheckOpString<float, double>(float const&, double const&, char const*)’:
ORBFeatureMatcher.cc:(.text._ZN6google17MakeCheckOpStringIfdEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIfdEEPSsRKT_RKT0_PKc]+0x58):undefined reference to ‘google::base::CheckOpMessageBuilder::NewString()’
CMakeFiles/FeatureTracker.dir/src/SuperPointFeatureDetector.cc.o:In function ‘_GLOBAL__sub_I_SuperPointFeatureDetector.cc’:
SuperPointFeatureDetector.cc:(.text.startup+0x10e):undefined reference to ‘google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)’
CMakeFiles/FeatureTracker.dir/src/SuperPointFeatureTracker.cc.o:In function ‘std::string* google::MakeCheckOpString<FeatureDescriptor<float>*, FeatureDescriptor<float>*>(FeatureDescriptor<float>* const&, FeatureDescriptor<float>* const&, char const*)’:
SuperPointFeatureTracker.cc:(.text._ZN6google17MakeCheckOpStringIP17FeatureDescriptorIfES3_EEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIP17FeatureDescriptorIfES3_EEPSsRKT_RKT0_PKc]+0x51):undefined reference to ‘google::base::CheckOpMessageBuilder::NewString()’
collect2: error: ld returned 1 exit status
CMakeFiles/FeatureTracker.dir/build.make:312: recipe for target 'FeatureTracker' failed
make[2]: *** [FeatureTracker] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/FeatureTracker.dir/all' failed
make[1]: *** [CMakeFiles/FeatureTracker.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I thought if I missed the libgflags and libglog libraries? But cmake .. didn't shown any error.
And afther I use sudo apt-get install libgoogle-glog-dev & sudo apt-get install libgflags-dev with add target_link_libraries(... libgflags.a libglog.a) to CMakeLists.txt. It still occurred errors.

Then I try to build and install gflags and glog from the Github official source code repository, I add FindGflags.cmake & FindGlog.cmake to project and add these codes to CMakeLists.txt:

find_package(gflags REQUIRED)
find_package(glog REQUIRED)

or

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
find_package(Gflags)
find_package(Glog)
include_directories(${GFLAGS_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS})
LIST(APPEND ALL_TARGET_LIBRARIES ${GLOG_LIBRARIES} ${GFLAGS_INCLUDE_DIRS})

...It still occurred these errors. I am very confused and could you please help me to know what's wrong with this problem?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions