Repository: opencv
Issue: opecv_contrib  xfeatures2d cuda surf compile error
Labels: bug,auto-transferred,priority: normal,affected: 3.4,category: gpu/cuda (contrib)

Transferred from http://code.opencv.org/issues/4140

```
|| Samuel Petrocelli on 2015-01-21 16:32
|| Priority: Normal
|| Affected: branch 'master' (3.0-dev)
|| Category: gpu (cuda)
|| Tracker: Bug
|| Difficulty: 
|| PR: 
|| Platform: x64 / Linux
```
## opecv_contrib  xfeatures2d cuda surf compile error

```
[ 93%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/surf.cuda.cpp.o
/usr/local/src/opencv_contrib/modules/xfeatures2d/src/surf.cuda.cpp: In constructor ‘{anonymous}::SURF_CUDA_Invoker::SURF_CUDA_Invoker(cv::cuda::SURF_CUDA&, const cv::cuda::GpuMat&, const cv::cuda::GpuMat&)’:
/usr/local/src/opencv_contrib/modules/xfeatures2d/src/surf.cuda.cpp:149:59: error: invalid initialization of reference of type ‘cv::cuda::Stream&’ from expression of type ‘cv::cuda::GpuMat’
             cuda::integral(img, surf_.sum, surf_.intBuffer);
                                                           ^
In file included from /usr/local/src/opencv/build/modules/xfeatures2d/precomp.hpp:63:0:
/usr/local/src/opencv/modules/cudaarithm/include/opencv2/cudaarithm.hpp:699:17: error: in passing argument 3 of ‘void cv::cuda::integral(cv::InputArray, cv::OutputArray, cv::cuda::Stream&)’
 CV_EXPORTS void integral(InputArray src, OutputArray sum, Stream& stream = Stream::Null());
                 ^
/usr/local/src/opencv_contrib/modules/xfeatures2d/src/surf.cuda.cpp:155:75: error: invalid initialization of reference of type ‘cv::cuda::Stream&’ from expression of type ‘cv::cuda::GpuMat’
                 cuda::integral(surf_.mask1, surf_.maskSum, surf_.intBuffer);
                                                                           ^
In file included from /usr/local/src/opencv/build/modules/xfeatures2d/precomp.hpp:63:0:
/usr/local/src/opencv/modules/cudaarithm/include/opencv2/cudaarithm.hpp:699:17: error: in passing argument 3 of ‘void cv::cuda::integral(cv::InputArray, cv::OutputArray, cv::cuda::Stream&)’
 CV_EXPORTS void integral(InputArray src, OutputArray sum, Stream& stream = Stream::Null());
                 ^
make[2]: *** [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/surf.cuda.cpp.o] Error 1
make[1]: *** [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/all] Error 2
make: *** [all] Error 2
[root@spetroce build]# gedit /usr/local/src/opencv_contrib/modules/xfeatures2d/src/surf.cuda.cpp 
^C
[root@spetroce build]# gedit /usr/local/src/opencv_contrib/modules/xfeatures2d/src/surf.cuda.cpp 

(gedit:25630): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

(gedit:25630): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
```
## History
##### Tomasz Pietruszka on 2015-01-29 21:36

```
Just wanted to confirm it happening, 
in my case x86 architecture, ubuntu, eg.:
<pre>
cmake -D CMAKE_BUILD_TYPE=RELEASE -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DBUILD_EXAMPLES=ON -DBUILD_PERF_TESTS=OFF -DWITH_IPP=OFF -DCUDA_ARCH_BIN="2.0" ..
</pre>
```
##### Nicolas Thorstensen on 2015-02-03 15:47

```
I know how to fix this. Where should I post the solution?
```
##### Steven Puttemans on 2015-02-04 07:52

```
Nicolas Thorstensen wrote:
> I know how to fix this. Where should I post the solution?

Of course you should. And better yet, supply a PR with the fix!
```
##### Steven Puttemans on 2015-02-04 07:52

```
-   Priority changed from Blocker to Normal
-   Status changed from New to Open
```
##### Vadim Pisarevsky on 2015-04-27 12:58

```
-   Category set to gpu (cuda)
```