ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to solve 'cannot convert ‘int*’ to ‘cv::DescriptorExtractor*’ in initialization'?

asked 2012-10-07 16:51:13 -0600

sam gravatar image

I followed bigg_detector.

  sam@sam:~/code/ros/recognition/bigg_detector$ rosmake
  [ rosmake ] rosmake starting...                                                                                                                
  [ rosmake ] No package specified.  Building ['bigg_detector']                                                                                  
  [ rosmake ] Packages requested are: ['bigg_detector']                                                                                          
  [ rosmake ] Logging to directory /home/sam/.ros/rosmake/rosmake_output-20121008-104935                                                         
  [ rosmake ] Expanded args ['bigg_detector'] to:
  ['bigg_detector']                                                                              
  [rosmake-0] Starting >>> rosbuild [ make ]                                                                                                     
  [rosmake-1] Starting >>> roslib [ make ]                                                                                                       
  [rosmake-2] Starting >>> rosconsole [ make ]                                                                                                   
  [rosmake-3] Starting >>> roslang [ make ]                                                                                                      
  [rosmake-1] Finished <<< roslib  No Makefile in package roslib                                                                                 
  [rosmake-1] Starting >>> bond [ make ]                                                                                                         
  [rosmake-2] Finished <<< rosconsole  No Makefile in package rosconsole                                                                         
  [rosmake-0] Finished <<< rosbuild  No Makefile in package rosbuild                                                                             
  [rosmake-3] Finished <<< roslang  No Makefile in package roslang                                                                               
  [rosmake-2] Starting >>> smclib [ make ]                                                                                                       
  [rosmake-0] Starting >>> pluginlib [ make ]                                                                                                    
  [rosmake-3] Starting >>> roscpp [ make ]                                                                                                       
  [rosmake-2] Finished <<< smclib ROS_NOBUILD in package smclib                                                                                  
  [rosmake-3] Finished <<< roscpp  No Makefile in package roscpp                                                                                 
  [rosmake-1] Finished <<< bond ROS_NOBUILD in package bond                                                                                      
  [rosmake-2] Starting >>> rospy [ make ]                                                                                                        
  [rosmake-0] Finished <<< pluginlib ROS_NOBUILD in package pluginlib                                                                            
  [rosmake-1] Starting >>> opencv2 [ make ]                                                                                                      
  [rosmake-3] Starting >>> bondcpp [ make ]                                                                                                      
  [rosmake-2] Finished <<< rospy  No Makefile in package rospy                                                                                   
  [rosmake-0] Starting >>> geometry_msgs [ make ]                                                                                                
  [rosmake-2] Starting >>> rosservice [ make ]                                                                                                   
  [rosmake-3] Finished <<< bondcpp ROS_NOBUILD in package bondcpp                                                                                
  [rosmake-2] Finished <<< rosservice  No Makefile in package rosservice                                                                         
  [rosmake-1] Finished <<< opencv2 ROS_NOBUILD in package opencv2                                                                                
  [rosmake-3] Starting >>> nodelet [ make ]                                                                                                      
  [rosmake-2] Starting >>> dynamic_reconfigure [ make ]                                                                                          
  [rosmake-0] Finished <<< geometry_msgs  No Makefile in package geometry_msgs                                                                   
  [rosmake-1] Starting >>> bullet [ make ]                                                                                                       
  [rosmake-0] Starting >>> sensor_msgs [ make ]                                                                                                  
  [rosmake-2] Finished <<< dynamic_reconfigure ROS_NOBUILD in package dynamic_reconfigure                                                        
  [rosmake-3] Finished <<< nodelet ROS_NOBUILD in package nodelet                                                                                
  [rosmake-0] Finished <<< sensor_msgs  No Makefile in package sensor_msgs                                                                       
  [rosmake-2] Starting >>> angles [ make ]                                                                                                       
  [rosmake-0] Starting >>> rostest [ make ]                                                                                                      
  [rosmake-1] Finished <<< bullet ROS_NOBUILD in package bullet                                                                                  
  [rosmake-3] Starting >>> roswtf [ make ]                                                                                                       
  [rosmake-1] Starting >>> message_filters [ make ]                                                                                              
  [rosmake-2] Finished <<< angles ROS_NOBUILD in package angles                                                                                  
  [rosmake-2] Starting >>> rosbag [ make ]                                                                                                       
  [rosmake-1] Finished <<< message_filters  No Makefile in package message_filters                                                               
  [rosmake-1] Starting >>> std_msgs [ make ]                                                                                                     
  [rosmake-3] Finished <<< roswtf  No Makefile in package roswtf                                                                                 
  [rosmake-0] Finished <<< rostest  No Makefile in package rostest                                                                               
  [rosmake-1] Finished <<< std_msgs  No Makefile in package std_msgs                                                                             
  [rosmake-2] Finished <<< rosbag  No Makefile in package rosbag                                                                                 
  [rosmake-1] Starting >>> nodelet_topic_tools [ make ]                                                                                          
  [rosmake-3] Starting >>> tf [ make ]                                                                                                           
  [rosmake-2] Starting >>> image_geometry [ make ]                                                                                               
  [rosmake-0] Starting >>> common_rosdeps [ make ]                                                                                               
  [rosmake-1] Finished <<< nodelet_topic_tools ROS_NOBUILD in package nodelet_topic_tools                                                        
  [rosmake-2] Finished <<< image_geometry ROS_NOBUILD in package image_geometry                                                                  
  [rosmake-1] Starting >>> cv_bridge [ make ]                                                                                                    
  [rosmake-2] Starting >>> image_transport [ make ]                                                                                              
  [rosmake-3] Finished <<< tf ROS_NOBUILD in package tf                                                                                          
  [rosmake-1] Finished <<< cv_bridge ROS_NOBUILD in package cv_bridge                                                                            
  [rosmake-2] Finished <<< image_transport ROS_NOBUILD in package image_transport                                                                
  [rosmake-0] Finished <<< common_rosdeps ROS_NOBUILD in package common_rosdeps                                                                  
  [rosmake-1] Starting >>> pcl [ make ]                                                                                                          
  [rosmake-1] Finished <<< pcl  No Makefile in package pcl                                                                                       
  [rosmake-2] Starting >>> flann [ make ]                                                                                                        
  [rosmake-3] Starting >>> pcl_ros [ make ]                                                                                                      
  [rosmake-3] Finished <<< pcl_ros ROS_NOBUILD in package pcl_ros                                                                                
  [rosmake-2] Finished <<< flann ROS_NOBUILD in package flann                                                                                    
  [rosmake-3] Starting >>> rein [ make ]                                                                                                         
  [rosmake-3] Finished <<< rein [SKIP] No rule to make target None                                                                               
  [rosmake-3] Starting >>> bigg_detector [ make ]                                                                                                
  [ rosmake ] Last 40 linesgg_detector: 3.1 sec ]                                                                     [ 1 Active 33/34 Complete ]
  {-------------------------------------------------------------------------------
    Finding dependencies for /home/sam/code/ros/recognition/bigg_detector/cfg/BiGG.cfg
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:

        CMAKE_TOOLCHAIN_FILE


    -- Build files have been written to: /home/sam/code/ros/recognition/bigg_detector/build
    cd build && make -l4
    make[1]: Entering directory `/home/sam/code/ros/recognition/bigg_detector/build'
    make[2]: Entering directory `/home/sam/code/ros/recognition ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2012-10-07 23:18:35 -0600

updated 2012-10-29 00:01:01 -0600

The error message "expected type-specifier" on the preceding line indicates that you have misspelled a type name or forgot to #include the appropriate header file where the type is defined. From this point on, the parser is thrown off the track, which means the error message about the int conversion is bogus and will disappear once you fix the original error. (It's probably some ancient C rule about converting unknown types to int by default.)

Update: The offending line according to the posted sources (see comment below) is

static cv::DescriptorExtractor* descriptorExtractor = new cv::SiftDescriptorExtractor;

and the error message (line 89, column 61) points to the cv::SiftDescriptorExtractor part. On my system, this class is defined in the header <opencv2/nonfree/features2d.hpp>, which (as far as I can tell) is not included anywhere.

NB. This is not rocket science. All the information you needed was there, and I even pointed you in the right direction.

edit flag offensive delete link more

Comments

I'm not quite understand how to solve it? Thank you~

sam gravatar image sam  ( 2012-10-14 00:50:10 -0600 )edit

You solve it by correcting the spelling error. It is also possible that you forgot a semicolon ';' or a brace '}' somewhere before. Without the source code, I can't be more specific.

roehling gravatar image roehling  ( 2012-10-15 21:55:16 -0600 )edit

Thank you~ Here is the source code. I'm still find somewhere to fix: svn co https://code.ros.org/svn/wg-ros-pkg/branches/trunk_diamondback/stacks/object_recognition/bigg_detector

sam gravatar image sam  ( 2012-10-26 23:24:53 -0600 )edit

This package should work before, because it is released already. I'm not understand why workable package will also meet header missing problem. How to explain that?

sam gravatar image sam  ( 2012-10-30 17:22:33 -0600 )edit

Maybe it was written for a different ROS version with a different OpenCV version? There have been some significant changes around version 2.3

roehling gravatar image roehling  ( 2012-10-30 23:13:25 -0600 )edit

That connects a big problem. How you think such a great library doesn't support backward compatibility? Also ROS distribution also seems not support compatibility too. ex.eigen dependency problem.

sam gravatar image sam  ( 2012-10-31 02:11:48 -0600 )edit

Question Tools

Stats

Asked: 2012-10-07 16:51:13 -0600

Seen: 350 times

Last updated: Oct 29 '12