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

Compilation Error #1

Open
iamdeeban opened this issue Sep 2, 2019 · 3 comments
Open

Compilation Error #1

iamdeeban opened this issue Sep 2, 2019 · 3 comments

Comments

@iamdeeban
Copy link

I downloaded the DCFG to visualize CFG of a particular binary in DOT format. I think I have already installed the dyninst and the dynamic libraries successfully. However, I still come across the following compilation problem

angr@BinWorks:~/Desktop/dyninst-install/dyninst_CFG$ make
[ 25%] Building CXX object CMakeFiles/CFG.dir/CFG.cpp.o
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp: In function ‘void PrintBlockInfo(Dyninst::ParseAPI::Block*)’:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: error: no match for ‘operator=’ (operand types are ‘Dyninst::InstructionAPI::Instruction::Ptr {aka boost::shared_ptr<Dyninst::InstructionAPI::Instruction>}’ and ‘Dyninst::InstructionAPI::Instruction’)
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:524:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr const & r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:524:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘const boost::shared_ptr<Dyninst::InstructionAPI::Instruction>&’
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:533:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<Y>&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:533:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘const boost::shared_ptr<X>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:544:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::auto_ptr<Y> & r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:544:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::auto_ptr<Y>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:553:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::auto_ptr<Y> && r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:553:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::auto_ptr<Y>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:575:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::unique_ptr<_Up, _Ep>&&) [with Y = Y; D = D; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::unique_ptr<Y, D> && r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:575:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::unique_ptr<_Tp, _Dp>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:584:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::movelib::unique_ptr<Y, D>) [with Y = Y; D = D; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:584:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘boost::movelib::unique_ptr<Y, D>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:632:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<T>&&) [with T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:632:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘boost::shared_ptr<Dyninst::InstructionAPI::Instruction>&&’
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:639:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<Y>&&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:639:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘boost::shared_ptr<X>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:649:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::detail::sp_nullptr_t) [with T = Dyninst::InstructionAPI::Instruction; boost::detail::sp_nullptr_t = std::nullptr_t]
     shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:649:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘boost::detail::sp_nullptr_t {aka std::nullptr_t}’
CMakeFiles/CFG.dir/build.make:62: recipe for target 'CMakeFiles/CFG.dir/CFG.cpp.o' failed
make[2]: *** [CMakeFiles/CFG.dir/CFG.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/CFG.dir/all' failed
make[1]: *** [CMakeFiles/CFG.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I am new to dyninst. Am I missing any library? does anyone know the reason? Thanks!

@yanyh15
Copy link
Member

yanyh15 commented Sep 3, 2019

The whole repo and work have not been updated. From our error msg, it is likely versioning if you are using different version of Boost, gcc/g++.

@iamdeeban
Copy link
Author

Thank you. I am using boost 1.65. What version would you suggest based on the code you developed and tested earlier?

@1Husin-Alhaj
Copy link

I have faced with the same error!! .. and here I do not see any solution or suggestion from the authors.
Please tell us what is the best version of boost to be used with the CFG Tool.

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

3 participants