Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘slots_reference’ was not declared in this scope #387

Closed
RG2806 opened this issue Sep 20, 2021 · 17 comments
Closed

error: ‘slots_reference’ was not declared in this scope #387

RG2806 opened this issue Sep 20, 2021 · 17 comments

Comments

@RG2806
Copy link

RG2806 commented Sep 20, 2021

/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

@owolabioromidayo
Copy link

were you able to fix it?

@RG2806
Copy link
Author

RG2806 commented Sep 24, 2021

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

@maghauke
Copy link

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

@RG2806
Copy link
Author

RG2806 commented Sep 28, 2021

yes,

@senliontec
Copy link

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

@rgreid
Copy link

rgreid commented Oct 15, 2021

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.

@owlshrimp
Copy link

owlshrimp commented Nov 3, 2021

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?

@rgreid
Copy link

rgreid commented Nov 3, 2021

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.

@ly-uuu
Copy link

ly-uuu commented Dec 1, 2021

This didn't work for me

@bilal-rabbani-ai
Copy link

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

@Mechazo11
Copy link

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 ?

@burhanbs
Copy link

burhanbs commented Mar 11, 2022

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

@owlshrimp
Copy link

owlshrimp commented Mar 11, 2022

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.

@jc211
Copy link

jc211 commented Mar 21, 2022

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)

@Kin-Zhang
Copy link

Kin-Zhang commented May 13, 2022

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)

@sameer196
Copy link

This worked for me:

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

I was able to compile and excecute all the demos

@baimo0001
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests