ORB_SLAM3 icon indicating copy to clipboard operation
ORB_SLAM3 copied to clipboard

error: ‘slots_reference’ was not declared in this scope

Open RG2806 opened this issue 5 years ago • 18 comments

/home/rohan/Pangolin/components/pango_core/include/sigslot/signal.hpp:1180:65: error: ‘slots_reference’ was not declared in this scope 1180 | cow_copy_type<list_type, Lockable> ref = slots_reference(); | ~~~~~~~~~~~~~~~^~ make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:104: CMakeFiles/ORB_SLAM3.dir/src/LocalMapping.cc.o] Error 1 make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:272: CMakeFiles/ORB_SLAM3.dir/src/Frame.cc.o] Error 1 make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:118: CMakeFiles/ORB_SLAM3.dir/src/LoopClosing.cc.o] Error 1 make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:90: CMakeFiles/ORB_SLAM3.dir/src/Tracking.cc.o] Error 1 make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:356: CMakeFiles/ORB_SLAM3.dir/src/G2oTypes.cc.o] Error 1 make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:258: CMakeFiles/ORB_SLAM3.dir/src/Optimizer.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:358: CMakeFiles/ORB_SLAM3.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

RG2806 avatar Sep 20 '21 06:09 RG2806

were you able to fix it?

owolabioromidayo avatar Sep 24 '21 01:09 owolabioromidayo

yes, you need to change the compiler version in cmakelist.txt from c++11 -> c++14

RG2806 avatar Sep 24 '21 04:09 RG2806

@RG2806 Do you mean c++11 - > c++14?

maghauke avatar Sep 28 '21 09:09 maghauke

yes,

RG2806 avatar Sep 28 '21 10:09 RG2806

@RG2806 Can you give some more details? Thanks alot.

senliontec avatar Oct 15 '21 05:10 senliontec

This worked for me:

sed -i 's/++11/++14/g' CMakeLists.txt

It's a bit hacky since the demos use #ifdef COMPILEDWITHC11 but it works.

rgreid avatar Oct 15 '21 14:10 rgreid

This worked for me:

sed -i 's/++11/++14/g' CMakeLists.txt

It's a bit hacky since the demos use #ifdef COMPILEDWITHC11 but it works.

Do the demos still work? If not, is there a way to make them work?

owlshrimp avatar Nov 03 '21 00:11 owlshrimp

Do the demos still work? If not, is there a way to make them work?

They all build fine after sed -i 's/++11/++14/g' CMakeLists.txt and I can confirm the TUM examples execute fine.

rgreid avatar Nov 03 '21 07:11 rgreid

This didn't work for me

ly-uuu avatar Dec 01 '21 14:12 ly-uuu

This worked for me:

sed -i 's/++11/++14/g' CMakeLists.txt

It's a bit hacky since the demos use #ifdef COMPILEDWITHC11 but it works.

worked for me

bilal-rabbani-ai avatar Jan 03 '22 09:01 bilal-rabbani-ai

sed -i 's/++11/++14/g' CMakeLists.txt

@rgreid This also worked for me. Thank you so much. But I was wondering, what is this command doing to the CMakeLists ?

Mechazo11 avatar Mar 11 '22 17:03 Mechazo11

sed -i 's/++11/++14/g' CMakeLists.txt

@rgreid This also worked for me. Thank you so much. But I was wondering, what is this command doing to the CMakeLists ?

hello Mechazo, could you please tell me where to add this command in cmakelist.txt. i am confusing..??

thanks alot

burhanbs avatar Mar 11 '22 20:03 burhanbs

sed -i 's/++11/++14/g' CMakeLists.txt

@rgreid This also worked for me. Thank you so much. But I was wondering, what is this command doing to the CMakeLists ?

hello Mechazo, could you please tell me where to add this command in cmakelist.txt. i am confusing..??

thanks alot

This is a command to run in the terminal that will replace "++11" with "++14" in the CMakeLists.txt files. You do not put it in the files themselves.

owlshrimp avatar Mar 11 '22 20:03 owlshrimp

In CMakeLists.txt, remove

# Check C++11 or C++0x support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   add_definitions(-DCOMPILEDWITHC11)
   message(STATUS "Using flag -std=c++11.")
elseif(COMPILER_SUPPORTS_CXX0X)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   add_definitions(-DCOMPILEDWITHC0X)
   message(STATUS "Using flag -std=c++0x.")
else()
   message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

and add

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)

jc211 avatar Mar 21 '22 01:03 jc211

In CMakeLists.txt, remove

# Check C++11 or C++0x support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   add_definitions(-DCOMPILEDWITHC11)
   message(STATUS "Using flag -std=c++11.")
elseif(COMPILER_SUPPORTS_CXX0X)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   add_definitions(-DCOMPILEDWITHC0X)
   message(STATUS "Using flag -std=c++0x.")
else()
   message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

and add

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)

It works for me. Thanks! btw, rem add add_definitions(-DCOMPILEDWITHC11)

# # Check C++11 or C++0x support
# include(CheckCXXCompilerFlag)
# CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
# CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
# if(COMPILER_SUPPORTS_CXX11)
#    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#    add_definitions(-DCOMPILEDWITHC11)
#    message(STATUS "Using flag -std=c++11.")
# elseif(COMPILER_SUPPORTS_CXX0X)
#    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
#    add_definitions(-DCOMPILEDWITHC0X)
#    message(STATUS "Using flag -std=c++0x.")
# else()
#    message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
# endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
add_definitions(-DCOMPILEDWITHC11)

Kin-Zhang avatar May 13 '22 15:05 Kin-Zhang

This worked for me:

sed -i 's/++11/++14/g' CMakeLists.txt

I was able to compile and excecute all the demos

sameer196 avatar Sep 20 '22 04:09 sameer196

sed -i 's/++11/++14/g' CMakeLists.txt This worked for me, but you should use "make" instead of "make -j4". I do not know the reason.

baimo0001 avatar Nov 18 '23 09:11 baimo0001

This worked for me:

sed -i 's/++11/++14/g' CMakeLists.txt

It's a bit hacky since the demos use #ifdef COMPILEDWITHC11 but it works.

It works!

Layort avatar Mar 25 '25 03:03 Layort